Struct FetchPacScript
pub struct FetchPacScript { /* private fields */ }js and pac and std only.Expand description
Always fetches the script, through the given http client.
The client decides what works: layer it with
FileUriLayer and
DataUriLayer to also accept
file:// and data: script uris, and with a redirect policy if the
script url redirects — a non-2xx answer is a failed fetch here. Bodies
are decoded as UTF-8 when valid and otherwise as Latin-1, matching
Firefox’s PAC loader compatibility behavior.
Implementations§
§impl FetchPacScript
impl FetchPacScript
pub const DEFAULT_MAX_SIZE: usize
pub const DEFAULT_MAX_SIZE: usize
Largest script accepted by default; Chromium caps PAC files at this size.
pub const DEFAULT_TIMEOUT: Duration
pub const DEFAULT_TIMEOUT: Duration
Default budget for one fetch: connect, headers and body.
pub fn new<S>(client: S) -> FetchPacScript
pub fn new<S>(client: S) -> FetchPacScript
Fetch PAC scripts with the given http client.
pub fn with_max_size(self, max_size: usize) -> FetchPacScript
pub fn with_max_size(self, max_size: usize) -> FetchPacScript
Reject scripts larger than this
(defaults to Self::DEFAULT_MAX_SIZE).
pub fn set_max_size(&mut self, max_size: usize) -> &mut FetchPacScript
pub fn set_max_size(&mut self, max_size: usize) -> &mut FetchPacScript
Reject scripts larger than this
(defaults to Self::DEFAULT_MAX_SIZE).
pub fn with_timeout(self, timeout: Duration) -> FetchPacScript
pub fn with_timeout(self, timeout: Duration) -> FetchPacScript
Budget for one fetch — connect, headers and body
(defaults to Self::DEFAULT_TIMEOUT).
pub fn set_timeout(&mut self, timeout: Duration) -> &mut FetchPacScript
pub fn set_timeout(&mut self, timeout: Duration) -> &mut FetchPacScript
Budget for one fetch — connect, headers and body
(defaults to Self::DEFAULT_TIMEOUT).
Trait Implementations§
§impl Debug for FetchPacScript
impl Debug for FetchPacScript
§impl Service<Uri> for FetchPacScript
impl Service<Uri> for FetchPacScript
§type Error = OpaqueError
type Error = OpaqueError
§async fn serve(
&self,
uri: Uri,
) -> Result<<FetchPacScript as Service<Uri>>::Output, <FetchPacScript as Service<Uri>>::Error>
async fn serve( &self, uri: Uri, ) -> Result<<FetchPacScript as Service<Uri>>::Output, <FetchPacScript 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 FetchPacScript
impl !UnwindSafe for FetchPacScript
impl Freeze for FetchPacScript
impl Send for FetchPacScript
impl Sync for FetchPacScript
impl Unpin for FetchPacScript
impl UnsafeUnpin for FetchPacScript
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
§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