pub struct Subscription {
pub id: u64,
pub pattern: Topic,
pub subscriber: KernelId,
receiver: Receiver<Publication>,
broker: Arc<PubSubBroker>,
}Expand description
A subscription to a topic.
Fields§
§id: u64Subscription ID.
pattern: TopicTopic pattern (may include wildcards).
subscriber: KernelIdSubscriber kernel ID.
receiver: Receiver<Publication>Message receiver.
broker: Arc<PubSubBroker>Reference to broker for unsubscribe.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub async fn receive(&mut self) -> Option<Publication>
pub async fn receive(&mut self) -> Option<Publication>
Receive the next publication.
Sourcepub fn try_receive(&mut self) -> Option<Publication>
pub fn try_receive(&mut self) -> Option<Publication>
Try to receive a publication (non-blocking).
Sourcepub fn unsubscribe(self)
pub fn unsubscribe(self)
Unsubscribe from the topic.
Auto Trait Implementations§
impl Freeze for Subscription
impl !RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl !UnwindSafe for Subscription
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.