Struct PacGenerator
pub struct PacGenerator { /* private fields */ }js and pac and std only.Expand description
Builds a PAC script that routes matching hosts to given proxies.
Rules are tried in order and the first match wins; anything unmatched falls through to the default route.
Implementations§
§impl PacGenerator
impl PacGenerator
pub fn new() -> PacGenerator
pub fn new() -> PacGenerator
Create a new PacGenerator.
pub fn with_route(
self,
directives: PacDirectives,
domains: impl IntoIterator<Item = Domain>,
) -> PacGenerator
pub fn with_route( self, directives: PacDirectives, domains: impl IntoIterator<Item = Domain>, ) -> PacGenerator
Route the given domains, and any of their subdomains, through
these directives: example.com also matches www.example.com.
A wildcard domain (*.example.com) is read as rama reads it
everywhere else: its parent and everything under it.
pub fn set_route(
&mut self,
directives: PacDirectives,
domains: impl IntoIterator<Item = Domain>,
) -> &mut PacGenerator
pub fn set_route( &mut self, directives: PacDirectives, domains: impl IntoIterator<Item = Domain>, ) -> &mut PacGenerator
See Self::with_route.
pub fn with_exact_route(
self,
directives: PacDirectives,
domains: impl IntoIterator<Item = Domain>,
) -> PacGenerator
pub fn with_exact_route( self, directives: PacDirectives, domains: impl IntoIterator<Item = Domain>, ) -> PacGenerator
Route exactly the given domains, and no subdomain of them, through these directives.
A wildcard domain (*.example.com) keeps its own meaning — parent
and subdomains — as it does in Self::with_route.
pub fn set_exact_route(
&mut self,
directives: PacDirectives,
domains: impl IntoIterator<Item = Domain>,
) -> &mut PacGenerator
pub fn set_exact_route( &mut self, directives: PacDirectives, domains: impl IntoIterator<Item = Domain>, ) -> &mut PacGenerator
pub fn maybe_with_default_route(
self,
directives: Option<PacDirectives>,
) -> PacGenerator
pub fn maybe_with_default_route( self, directives: Option<PacDirectives>, ) -> PacGenerator
What to return when no route matches (defaults to DIRECT).
pub fn maybe_set_default_route(
&mut self,
directives: Option<PacDirectives>,
) -> &mut PacGenerator
pub fn maybe_set_default_route( &mut self, directives: Option<PacDirectives>, ) -> &mut PacGenerator
What to return when no route matches (defaults to DIRECT).
pub fn with_default_route(self, directives: PacDirectives) -> PacGenerator
pub fn with_default_route(self, directives: PacDirectives) -> PacGenerator
What to return when no route matches (defaults to DIRECT).
pub fn set_default_route(
&mut self,
directives: PacDirectives,
) -> &mut PacGenerator
pub fn set_default_route( &mut self, directives: PacDirectives, ) -> &mut PacGenerator
What to return when no route matches (defaults to DIRECT).
pub fn without_default_route(self) -> PacGenerator
pub fn without_default_route(self) -> PacGenerator
What to return when no route matches (defaults to DIRECT).
pub fn unset_default_route(&mut self) -> &mut PacGenerator
pub fn unset_default_route(&mut self) -> &mut PacGenerator
What to return when no route matches (defaults to DIRECT).
Trait Implementations§
§impl Clone for PacGenerator
impl Clone for PacGenerator
§fn clone(&self) -> PacGenerator
fn clone(&self) -> PacGenerator
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 PacGenerator
impl Debug for PacGenerator
§impl Default for PacGenerator
impl Default for PacGenerator
§fn default() -> PacGenerator
fn default() -> PacGenerator
Auto Trait Implementations§
impl Freeze for PacGenerator
impl RefUnwindSafe for PacGenerator
impl Send for PacGenerator
impl Sync for PacGenerator
impl Unpin for PacGenerator
impl UnsafeUnpin for PacGenerator
impl UnwindSafe for PacGenerator
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<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