pub struct AsyncNetworkCore { /* private fields */ }Expand description
Per-thread driver for the shared network state.
The tokio runtime and its [LocalSet] are !Send, so each pool worker
owns one of these; the expensive state they operate on lives in the
SharedNetState behind an Arc and is reused across workers.
The SenderPool deliberately lives here, not in the shared state: a
pooled connection’s driver task is spawned onto the creating worker’s
local set and is only polled while that worker runs a fetch. Sharing
senders across runtimes would let one worker check out a connection whose
driver is parked on another (idle) worker, leaving the request awaiting
frames nobody ever reads.
Implementations§
Source§impl AsyncNetworkCore
impl AsyncNetworkCore
pub fn new(inner: Arc<SharedNetState>) -> Self
Sourcepub fn fetch_request_blocking(
&self,
request: &NetworkRequest,
) -> Result<Response, NetworkError>
pub fn fetch_request_blocking( &self, request: &NetworkRequest, ) -> Result<Response, NetworkError>
Runs a fetch to completion on this worker’s local set.
Source§impl AsyncNetworkCore
impl AsyncNetworkCore
pub async fn fetch_request( &self, request: &NetworkRequest, ) -> Result<Response, NetworkError>
Auto Trait Implementations§
impl !Freeze for AsyncNetworkCore
impl !RefUnwindSafe for AsyncNetworkCore
impl !Send for AsyncNetworkCore
impl !Sync for AsyncNetworkCore
impl !UnwindSafe for AsyncNetworkCore
impl Unpin for AsyncNetworkCore
impl UnsafeUnpin for AsyncNetworkCore
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
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more