Skip to main content

SubscriptionResource

Trait SubscriptionResource 

Source
pub trait SubscriptionResource: Debug + Send {
    // Required methods
    fn unsubscribe(self: Box<Self>) -> Result<(), ServerError>;
    fn try_next(&mut self) -> Option<Envelope>;
}
Expand description

Marker for resources retained by a connection process until unsubscribe.

Required Methods§

Source

fn unsubscribe(self: Box<Self>) -> Result<(), ServerError>

Releases the library subscription resource.

§Errors

Returns ServerError when the liminal library reports an unsubscribe failure.

Source

fn try_next(&mut self) -> Option<Envelope>

Attempts to pull the next delivered envelope from the wrapped library subscription without blocking.

Returns None when the subscriber inbox is empty (or momentarily unavailable): the connection process is the delivery pump, so a transient empty read is simply “nothing to deliver this slice”, never an error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§