Enum PacDirective
pub enum PacDirective {
Direct,
Proxy(HostWithPort),
Https(HostWithPort),
Socks5(HostWithPort),
}js and pac and std only.Expand description
One proxy instruction returned by a PAC script.
Unsupported tokens (SOCKS/SOCKS4, vendor extensions) are dropped
while parsing, so every directive here is one rama can act on.
Variants§
Direct
Connect to the origin without a proxy.
Proxy(HostWithPort)
Proxy over http (PROXY / HTTP tokens).
Https(HostWithPort)
Proxy over https (HTTPS token).
Socks5(HostWithPort)
Proxy over socks5 (SOCKS5 token).
Implementations§
§impl PacDirective
impl PacDirective
pub fn proxy(address: impl Into<HostWithPort>) -> PacDirective
pub fn proxy(address: impl Into<HostWithPort>) -> PacDirective
Proxy over http, the PROXY directive.
pub fn https(address: impl Into<HostWithPort>) -> PacDirective
pub fn https(address: impl Into<HostWithPort>) -> PacDirective
Proxy over https, the HTTPS directive.
pub fn socks5(address: impl Into<HostWithPort>) -> PacDirective
pub fn socks5(address: impl Into<HostWithPort>) -> PacDirective
Proxy over socks5, the SOCKS5 directive.
pub fn proxy_address(&self) -> Option<ProxyAddress>
pub fn proxy_address(&self) -> Option<ProxyAddress>
The ProxyAddress to route through, or None for
PacDirective::Direct.
A SOCKS5 directive becomes Protocol::SOCKS5H: the proxy
resolves the name, as browsers do. Whether a name is resolved
locally instead is the socks5 connector’s configuration, not
something a PAC script expresses.
pub fn into_proxy_route(self) -> ProxyRoute
pub fn into_proxy_route(self) -> ProxyRoute
The ProxyRoute this directive selects.
Trait Implementations§
§impl Clone for PacDirective
impl Clone for PacDirective
§fn clone(&self) -> PacDirective
fn clone(&self) -> PacDirective
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PacDirective
impl Debug for PacDirective
§impl Display for PacDirective
impl Display for PacDirective
impl Eq for PacDirective
§impl FromIterator<PacDirective> for PacDirectives
impl FromIterator<PacDirective> for PacDirectives
§fn from_iter<I>(iter: I) -> PacDirectiveswhere
I: IntoIterator<Item = PacDirective>,
fn from_iter<I>(iter: I) -> PacDirectiveswhere
I: IntoIterator<Item = PacDirective>,
§impl PartialEq for PacDirective
impl PartialEq for PacDirective
impl StructuralPartialEq for PacDirective
Auto Trait Implementations§
impl !Freeze for PacDirective
impl RefUnwindSafe for PacDirective
impl Send for PacDirective
impl Sync for PacDirective
impl Unpin for PacDirective
impl UnsafeUnpin for PacDirective
impl UnwindSafe for PacDirective
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.