pub struct DriverSpawner { /* private fields */ }Expand description
Runtime placement for one partition’s connection-owned work.
Protocol drivers, establishment completion, deferred HTTP/1 readiness, and idle maintenance for a partition run through its spawner, even when another partition dispatches on one of its connections. The underlying I/O never moves to the requesting runtime.
A spawner is placement, not runtime ownership. It does not keep the runtime alive and does not participate in shutdown. When the owning runtime drops spawned work, the pool observes that through the connection’s own close path.
Callers on Tokio use [DriverSpawner::tokio] with the handle of the runtime
that should own the partition’s connections.
Implementations§
Source§impl DriverSpawner
impl DriverSpawner
Sourcepub fn from_fn<F>(spawn: F) -> Self
pub fn from_fn<F>(spawn: F) -> Self
Places connection-owned work through a caller-provided spawn function.
Each call transfers ownership of a connection-owned task. The callback must submit it to the runtime this partition represents and return promptly. Calls may arrive concurrently from different threads.
Tasks must make progress while that runtime is running. Dropping a task during shutdown follows the pool’s existing connection-close behavior. The callback returns neither a join handle nor a submission error. Runtime ownership and shutdown remain the caller’s responsibility.
Trait Implementations§
Source§impl Clone for DriverSpawner
impl Clone for DriverSpawner
Source§fn clone(&self) -> DriverSpawner
fn clone(&self) -> DriverSpawner
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DriverSpawner
impl !UnwindSafe for DriverSpawner
impl Freeze for DriverSpawner
impl Send for DriverSpawner
impl Sync for DriverSpawner
impl Unpin for DriverSpawner
impl UnsafeUnpin for DriverSpawner
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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