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>;
    fn has_pending(&self) -> bool;

    // Provided method
    fn is_overflowed(&self) -> bool { ... }
}
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.

Source

fn has_pending(&self) -> bool

Non-consuming availability query for the post-arm race barrier.

Provided Methods§

Source

fn is_overflowed(&self) -> bool

Whether an overflow has marked this subscription for shedding (§5). The delivery pump sheds an overflowed subscription with a typed error frame. Defaulted to false: a resource with no bounded inbox never overflows.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§