pub struct BusDriver { /* private fields */ }Expand description
Serving future owning the bus’s handler table. Shared dispatchers retain
descriptors, not handlers. The owner must poll or spawn this future for
dispatches to progress; it is Send on native targets and may be !Send on WASM.
Completes after command-owning dispatchers are dropped and in-flight work drains.
Dropping it fails unfinished and subsequent dispatches with BusClosed.
Implementations§
Source§impl BusDriver
impl BusDriver
Sourcepub fn register(
&mut self,
key: impl Into<HandlerKey>,
handler: impl Serve + 'static,
) -> Result<(), ErrorReport>
pub fn register( &mut self, key: impl Into<HandlerKey>, handler: impl Serve + 'static, ) -> Result<(), ErrorReport>
Register or replace key immediately, publishing its descriptor.
Returns an error if registration is refused by Registrar::register.
Sourcepub fn register_erased(
&mut self,
key: impl Into<HandlerKey>,
handler: ErasedHandler,
) -> Result<(), ErrorReport>
pub fn register_erased( &mut self, key: impl Into<HandlerKey>, handler: ErasedHandler, ) -> Result<(), ErrorReport>
Register an already-erased handler.
Sourcepub fn register_typed<F: Family>(
&mut self,
key: impl Into<HandlerKey>,
handler: impl Serve + 'static,
) -> Result<Key<F>, ErrorReport>
pub fn register_typed<F: Family>( &mut self, key: impl Into<HandlerKey>, handler: impl Serve + 'static, ) -> Result<Key<F>, ErrorReport>
Sourcepub fn deregister(&mut self, key: &HandlerKey) -> bool
pub fn deregister(&mut self, key: &HandlerKey) -> bool
Remove the handler serving key. Returns whether one was registered.
Sourcepub fn registrar(&self) -> Registrar
pub fn registrar(&self) -> Registrar
A handle for registering on this bus once the driver is out of hand
(spawned): see Registrar.
Sourcepub fn record_to(&mut self, recorder: impl Recorder + Send + Sync)
pub fn record_to(&mut self, recorder: impl Recorder + Send + Sync)
Record every served dispatch into recorder (a
rig_core::serve::Recorder); the handlers registered now are
handed to it first (Recorder::handlers), and each one installed
later as it is installed.
Sourcepub const fn config(&self) -> &ServingPolicy
pub const fn config(&self) -> &ServingPolicy
The serving policy.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for BusDriver
impl !RefUnwindSafe for BusDriver
impl !Sync for BusDriver
impl !UnwindSafe for BusDriver
impl Send for BusDriver
impl Unpin for BusDriver
impl UnsafeUnpin for BusDriver
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> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
Source§fn map_into<U>(self) -> MapInto<Self, U> ⓘ
fn map_into<U>(self) -> MapInto<Self, U> ⓘ
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
f. Read moreSource§fn left_future<B>(self) -> Either<Self, B> ⓘ
fn left_future<B>(self) -> Either<Self, B> ⓘ
Source§fn right_future<A>(self) -> Either<A, Self> ⓘ
fn right_future<A>(self) -> Either<A, Self> ⓘ
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Source§fn flatten(self) -> Flatten<Self> ⓘ
fn flatten(self) -> Flatten<Self> ⓘ
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
poll will never again be called once it has
completed. This method can be used to turn any Future into a
FusedFuture. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Source§fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
std only.std, or crate features alloc and spin only.Source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
channel and std only.() on completion and sends
its output to another future on a separate task. Read moreSource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
alloc only.Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
alloc only.Source§fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = ()>.Source§fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
Future<Output = T> into a
TryFuture<Ok = T, Error = Never>.