pub struct Provider(/* private fields */);Available on crate feature
net only.Expand description
The browser’s document and script network provider.
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn for_scope(
self: &Arc<Provider>,
initiator: Initiator,
) -> Arc<ScopedProvider> ⓘ
pub fn for_scope( self: &Arc<Provider>, initiator: Initiator, ) -> Arc<ScopedProvider> ⓘ
Bind a browser-issued principal before handing networking to a document.
pub fn new(waker: Option<Arc<dyn NetWaker>>) -> Provider
pub fn with_user_agent( waker: Option<Arc<dyn NetWaker>>, user_agent: &str, ) -> Provider
pub fn user_agent(&self) -> &str
pub fn is_empty(&self) -> bool
pub fn count(&self) -> usize
pub fn fetch_with_callback( &self, request: Request, callback: Box<dyn FnOnce(Result<(String, Bytes), ProviderError>) + Sync + Send>, )
pub async fn fetch_async( &self, request: Request, ) -> Result<(String, Bytes), ProviderError>
pub async fn fetch_response_async( &self, request: Request, ) -> Result<FetchResponse, ProviderError>
pub async fn fetch_platform_async( &self, request: FetchRequest, ) -> Result<FetchResponse, FetchError>
Trait Implementations§
Source§impl FetchProvider for Provider
impl FetchProvider for Provider
fn fetch(&self, request: FetchRequest, handler: Box<dyn FetchHandler>)
Source§impl NetProvider for Provider
impl NetProvider for Provider
fn fetch(&self, doc_id: usize, request: Request, handler: Box<dyn NetHandler>)
Source§fn for_child_document(&self, _url: Url) -> Option<Arc<dyn NetProvider>>
fn for_child_document(&self, _url: Url) -> Option<Arc<dyn NetProvider>>
Bind a child browsing context. srcdoc inherits the existing principal.
Source§fn resource_initiator(&self) -> Initiator
fn resource_initiator(&self) -> Initiator
The native principal held by a document-bound provider.
Source§fn is_noop(&self) -> bool
fn is_noop(&self) -> bool
Whether this provider is a no-op (e.g.
DummyNetProvider) that will never
deliver resources. When true, callers must NOT register resources as
“pending critical” — doing so blocks painting forever, since the
completion callback never fires. Used by integrations that feed a
pre-rendered DOM and perform no sub-fetches (e.g. aginxbrowser).Auto Trait Implementations§
impl !Freeze for Provider
impl !RefUnwindSafe for Provider
impl !UnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnsafeUnpin for Provider
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert