pub struct Service { /* private fields */ }Expand description
Handle to a registered service.
Dropping the handle implicitly unregisters the service.
Implementations§
Source§impl Service
impl Service
Sourcepub const fn handle(&self) -> ServiceHandle
pub const fn handle(&self) -> ServiceHandle
The underlying proto-layer service handle.
Sourcepub async fn next(&self) -> Option<ServiceUpdate>
pub async fn next(&self) -> Option<ServiceUpdate>
Wait for the next ServiceUpdate. Returns None once the service has
been retired (terminal delivered) or the driver task has exited.
Single-consumer: this mirrors crate::Query::next’s wakeup discipline,
where the capacity-1 doorbell assumes a single waiter.
Sourcepub async fn unregister(self) -> Result<(), CancelError>
pub async fn unregister(self) -> Result<(), CancelError>
Explicitly unregister the service. Equivalent to dropping the handle but returns an error if the driver task has already exited.
Trait Implementations§
Auto Trait Implementations§
impl !Unpin for Service
impl !UnsafeUnpin for Service
impl Freeze for Service
impl RefUnwindSafe for Service
impl Send for Service
impl Sync for Service
impl UnwindSafe for Service
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
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 more