Struct SystemPacProxy
pub struct SystemPacProxy { /* private fields */ }js and pac and std only.Expand description
Creates reusable PacResolver services for system-configured PAC URLs.
The compiled resolver is reused until the operating system reports a
different URL. Script-fetch caching remains explicit composition: wrap the
provider in PacScriptCacheLayer before
passing it to Self::new when desired. This type implements the PAC
factory contract accepted by
SystemProxyLayer.
Implementations§
§impl SystemPacProxy
impl SystemPacProxy
pub fn new<P>(provider: P) -> SystemPacProxy
pub fn new<P>(provider: P) -> SystemPacProxy
Create a system PAC factory backed by provider.
pub fn with_failure_policy(self, failure: PacFailurePolicy) -> SystemPacProxy
pub fn with_failure_policy(self, failure: PacFailurePolicy) -> SystemPacProxy
What to route through when the script cannot be consulted
(defaults to PacFailurePolicy::Fail).
pub fn set_failure_policy(
&mut self,
failure: PacFailurePolicy,
) -> &mut SystemPacProxy
pub fn set_failure_policy( &mut self, failure: PacFailurePolicy, ) -> &mut SystemPacProxy
What to route through when the script cannot be consulted
(defaults to PacFailurePolicy::Fail).
pub fn with_resolver_builder(
self,
builder: PacResolverBuilder,
) -> SystemPacProxy
pub fn with_resolver_builder( self, builder: PacResolverBuilder, ) -> SystemPacProxy
Configure the resolver used for a newly observed PAC URL.
pub fn set_resolver_builder(
&mut self,
builder: PacResolverBuilder,
) -> &mut SystemPacProxy
pub fn set_resolver_builder( &mut self, builder: PacResolverBuilder, ) -> &mut SystemPacProxy
Configure the resolver used for a newly observed PAC URL.
pub fn maybe_with_max_routes(
self,
max_routes: Option<NonZero<usize>>,
) -> SystemPacProxy
pub fn maybe_with_max_routes( self, max_routes: Option<NonZero<usize>>, ) -> SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
pub fn maybe_set_max_routes(
&mut self,
max_routes: Option<NonZero<usize>>,
) -> &mut SystemPacProxy
pub fn maybe_set_max_routes( &mut self, max_routes: Option<NonZero<usize>>, ) -> &mut SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
pub fn with_max_routes(self, max_routes: NonZero<usize>) -> SystemPacProxy
pub fn with_max_routes(self, max_routes: NonZero<usize>) -> SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
pub fn set_max_routes(
&mut self,
max_routes: NonZero<usize>,
) -> &mut SystemPacProxy
pub fn set_max_routes( &mut self, max_routes: NonZero<usize>, ) -> &mut SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
pub fn without_max_routes(self) -> SystemPacProxy
pub fn without_max_routes(self) -> SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
pub fn unset_max_routes(&mut self) -> &mut SystemPacProxy
pub fn unset_max_routes(&mut self) -> &mut SystemPacProxy
Limit the number of routes published per request.
The default is DEFAULT_PAC_MAX_ROUTES. Set None only when
the system PAC script is trusted with an unbounded fallback list.
Trait Implementations§
§impl Clone for SystemPacProxy
impl Clone for SystemPacProxy
§fn clone(&self) -> SystemPacProxy
fn clone(&self) -> SystemPacProxy
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 SystemPacProxy
impl Debug for SystemPacProxy
§impl Service<Uri> for SystemPacProxy
impl Service<Uri> for SystemPacProxy
§type Output = SystemPacResolver
type Output = SystemPacResolver
§async fn serve(
&self,
script_uri: Uri,
) -> Result<<SystemPacProxy as Service<Uri>>::Output, <SystemPacProxy as Service<Uri>>::Error>
async fn serve( &self, script_uri: Uri, ) -> Result<<SystemPacProxy as Service<Uri>>::Output, <SystemPacProxy as Service<Uri>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl !RefUnwindSafe for SystemPacProxy
impl !UnwindSafe for SystemPacProxy
impl Forget for SystemPacProxy
impl Freeze for SystemPacProxywhere
*const ArcInner<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync>>: Freeze,
*const ArcInner<dyn DynDnsAddressResolver + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn DynDnsAddressResolver + Send + Sync>>: Freeze,
InternalBitFlags: Freeze,
*const u8 is !null: Freeze,
PhantomData<IpAddr>: Freeze,
*const ArcInner<dyn Fn() -> ZonedDateTime + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn() -> ZonedDateTime + Send + Sync>>: Freeze,
PhantomData<(JsStr, GlobalEntry)>: Freeze,
*const ArcInner<Node> is !null: Freeze,
PhantomData<ArcInner<Node>>: Freeze,
*const ArcInner<Composite> is !null: Freeze,
PhantomData<ArcInner<Composite>>: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<ArcSwapAny<Option<Arc<CachedPacResolver>>>> is !null: Freeze,
PhantomData<ArcInner<ArcSwapAny<Option<Arc<CachedPacResolver>>>>>: Freeze,
*const ArcInner<Mutex<()>> is !null: Freeze,
PhantomData<ArcInner<Mutex<()>>>: Freeze,
*const [ProxyRoute] is !null: Freeze,
PhantomData<[ProxyRoute]>: Freeze,
*const [Option<Extensions>] is !null: Freeze,
PhantomData<[Option<Extensions>]>: Freeze,
NonZero<usize>: Freeze,
impl Move for SystemPacProxy
impl Send for SystemPacProxywhere
Arc<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync>: Send,
Arc<dyn DynDnsAddressResolver + Send + Sync>: Send,
InternalBitFlags: Send,
RawVecInner: Send,
Arc<dyn Fn() -> ZonedDateTime + Send + Sync>: Send,
&'static str: Send,
Arc<str>: Send,
Arc<[JsValue]>: Send,
Arc<[(JsStr, JsValue)]>: Send,
Arc<dyn Fn(Vec<JsValue>) -> Result<JsValue, JsError> + Send + Sync>: Send,
Arc<Node>: Send,
Arc<Composite>: Send,
Arc<ArcSwapAny<Option<Arc<CachedPacResolver>>>>: Send,
Arc<Mutex<()>>: Send,
BoxRaw<[ProxyRoute]>: Send,
BoxRaw<[Option<Extensions>]>: Send,
NonZero<usize>: Send,
impl Sync for SystemPacProxywhere
Arc<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync>: Sync,
Arc<dyn DynDnsAddressResolver + Send + Sync>: Sync,
InternalBitFlags: Sync,
RawVecInner: Sync,
Arc<dyn Fn() -> ZonedDateTime + Send + Sync>: Sync,
Arc<str>: Sync,
Arc<[JsValue]>: Sync,
Arc<[(JsStr, JsValue)]>: Sync,
Arc<dyn Fn(Vec<JsValue>) -> Result<JsValue, JsError> + Send + Sync>: Sync,
Arc<Node>: Sync,
Arc<Composite>: Sync,
Arc<ArcSwapAny<Option<Arc<CachedPacResolver>>>>: Sync,
Arc<Mutex<()>>: Sync,
BoxRaw<[ProxyRoute]>: Sync,
BoxRaw<[Option<Extensions>]>: Sync,
NonZero<usize>: Sync,
impl Unpin for SystemPacProxywhere
Arc<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync>: Unpin,
Arc<dyn DynDnsAddressResolver + Send + Sync>: Unpin,
InternalBitFlags: Unpin,
*const u8 is !null: Unpin,
Arc<dyn Fn() -> ZonedDateTime + Send + Sync>: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
Arc<[JsValue]>: Unpin,
Arc<[(JsStr, JsValue)]>: Unpin,
Arc<dyn Fn(Vec<JsValue>) -> Result<JsValue, JsError> + Send + Sync>: Unpin,
Arc<Node>: Unpin,
Arc<Composite>: Unpin,
Arc<ArcSwapAny<Option<Arc<CachedPacResolver>>>>: Unpin,
Arc<Mutex<()>>: Unpin,
Box<[ProxyRoute]>: Unpin,
Box<[Option<Extensions>]>: Unpin,
NonZero<usize>: Unpin,
impl UnsafeUnpin for SystemPacProxywhere
*const ArcInner<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn DynService<Uri, Error = OpaqueError, Output = PacScript> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<dyn DynDnsAddressResolver + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn DynDnsAddressResolver + Send + Sync>>: UnsafeUnpin,
InternalBitFlags: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<IpAddr>: UnsafeUnpin,
*const ArcInner<dyn Fn() -> ZonedDateTime + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn() -> ZonedDateTime + Send + Sync>>: UnsafeUnpin,
PhantomData<(JsStr, GlobalEntry)>: UnsafeUnpin,
*const ArcInner<Node> is !null: UnsafeUnpin,
PhantomData<ArcInner<Node>>: UnsafeUnpin,
*const ArcInner<Composite> is !null: UnsafeUnpin,
PhantomData<ArcInner<Composite>>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<ArcSwapAny<Option<Arc<CachedPacResolver>>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<ArcSwapAny<Option<Arc<CachedPacResolver>>>>>: UnsafeUnpin,
*const ArcInner<Mutex<()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<()>>>: UnsafeUnpin,
*const [ProxyRoute] is !null: UnsafeUnpin,
PhantomData<[ProxyRoute]>: UnsafeUnpin,
*const [Option<Extensions>] is !null: UnsafeUnpin,
PhantomData<[Option<Extensions>]>: UnsafeUnpin,
NonZeroUsizeInner: UnsafeUnpin,
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<Io, S> MakeMockServer<Io, ServerClone> for S
impl<Io, S> MakeMockServer<Io, ServerClone> for S
type Server = S
fn make_server(&self, _: &ConnectRequest) -> S
§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