Trait PublishSample

Source
pub trait PublishSample<'a>: Send + Sync {
    // Required methods
    fn as_mut_slice(&mut self) -> &mut [u8] ;
    fn publish(
        self: Box<Self>,
    ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>;
}
Expand description

A prepared message constructed by Publisher::prepare.

Required Methods§

Source

fn as_mut_slice(&mut self) -> &mut [u8]

Gets a reference to the prepared message.

Makes it possible to construct the message in-place.

Source

fn publish( self: Box<Self>, ) -> Result<(), Box<dyn Error + Send + Sync + 'static>>

Publish this sample to subscribers.

The sample is published to the topic that was used to create the corresponding publisher (see CommunicationLayer::publisher).

Implementors§