pub struct NetworkManager {
public_resource_threads: ResourceThreads,
private_resource_threads: ResourceThreads,
}Expand description
Provides APIs for managing network-related state.
NetworkManager is responsible for data owned by the networking layer,
such as the HTTP cache. This data is not considered site data and is
therefore intentionally separate from SiteDataManager.
Fields§
§public_resource_threads: ResourceThreads§private_resource_threads: ResourceThreadsImplementations§
Source§impl NetworkManager
impl NetworkManager
pub(crate) fn new( public_resource_threads: ResourceThreads, private_resource_threads: ResourceThreads, ) -> Self
Sourcepub fn cache_entries(&self) -> Vec<CacheEntry>
pub fn cache_entries(&self) -> Vec<CacheEntry>
Returns cache entries currently stored in the HTTP cache.
The returned list contains one CacheEntry per unique cache key
(URL) for which the networking layer currently maintains cached
responses.
Both public and private browsing contexts are included in the result.
Note: The networking layer currently only implements an in-memory HTTP cache. Support for an on-disk cache is under development.
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clears the network (HTTP) cache.
This removes all cached network responses maintained by the networking layer for both public and private browsing contexts.
Note: The networking layer currently only implements an in-memory HTTP cache. Support for an on-disk cache is under development.
Auto Trait Implementations§
impl Freeze for NetworkManager
impl !RefUnwindSafe for NetworkManager
impl Send for NetworkManager
impl !Sync for NetworkManager
impl Unpin for NetworkManager
impl !UnwindSafe for NetworkManager
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
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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>
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