Subscription

Trait Subscription 

Source
pub trait Subscription {
    // Required method
    fn next(&mut self) -> Result<Option<SubscriptionItem>, Error>;
}
Expand description

A trait for consuming field outputs from streams.

This trait provides an abstraction over different implementations of subscriptions to field output streams. Implementors should handle the details of their specific transport mechanism while providing a consistent interface for consumers.

Required Methods§

Source

fn next(&mut self) -> Result<Option<SubscriptionItem>, Error>

Retrieves the next field output from the subscription.

Returns:

  • Ok(Some(Data)) if a field output was available
  • Ok(None) if the subscription has ended normally
  • Err(Error) if an error occurred while retrieving the next field output

Implementors§