pub struct SpawnSubscription { /* private fields */ }Expand description
A held supervisor.spawn_subscribe request: the daemon’s spawn events, in cursor
order, until the stream ends. Dropping it cancels the request.
Implementations§
Source§impl SpawnSubscription
impl SpawnSubscription
Sourcepub async fn next(&mut self) -> Result<Option<SpawnEvent>, SpawnStreamError>
pub async fn next(&mut self) -> Result<Option<SpawnEvent>, SpawnStreamError>
The next event. Ok(None) is a clean end (the daemon ended the stream, or it was
unsubscribed); every later call returns it too.
Every event the daemon queued before a terminal error is yielded first, so the
last event received is the cursor to resume from. A refused cursor or a dropped
subscriber comes back as the matching SpawnStreamError variant; anything else
that ends the stream (connection loss, local backpressure, an event that does not
decode) is SpawnStreamError::Call or SpawnStreamError::Decode.
Sourcepub fn unsubscribe(&self) -> Result<(), CallError>
pub fn unsubscribe(&self) -> Result<(), CallError>
Cancel the held request; the daemon releases the subscriber.
Auto Trait Implementations§
impl !Freeze for SpawnSubscription
impl !RefUnwindSafe for SpawnSubscription
impl !UnwindSafe for SpawnSubscription
impl Forget for SpawnSubscription
impl Move for SpawnSubscription
impl Send for SpawnSubscription
impl Sync for SpawnSubscription
impl Unpin for SpawnSubscription
impl UnsafeUnpin for SpawnSubscription
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