embassy_sync::pubsub

Trait PubSubBehavior

Source
pub trait PubSubBehavior<T>: SealedPubSubBehavior<T> {
    // Required methods
    fn publish_immediate(&self, message: T);
    fn capacity(&self) -> usize;
    fn is_full(&self) -> bool;
}
Expand description

‘Middle level’ behaviour of the pubsub channel. This trait is used so that Sub and Pub can be generic over the channel.

Required Methods§

Source

fn publish_immediate(&self, message: T)

Publish a message immediately

Source

fn capacity(&self) -> usize

Returns the maximum number of elements the channel can hold.

Source

fn is_full(&self) -> bool

Returns whether the channel is full.

Implementors§

Source§

impl<M: RawMutex, T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usize> PubSubBehavior<T> for PubSubChannel<M, T, CAP, SUBS, PUBS>