Skip to main content

Publisher

Trait Publisher 

Source
pub trait Publisher: Send + Sync {
    // Required method
    fn publish<'life0, 'async_trait>(
        &'life0 self,
        resource_id: u16,
        call_options: CallOptions,
        payload: Option<UPayload>,
    ) -> Pin<Box<dyn Future<Output = Result<(), PubSubError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A client for publishing messages to a topic.

Please refer to the Communication Layer API Specifications.

Required Methods§

Source

fn publish<'life0, 'async_trait>( &'life0 self, resource_id: u16, call_options: CallOptions, payload: Option<UPayload>, ) -> Pin<Box<dyn Future<Output = Result<(), PubSubError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Publishes a message to a topic.

§Arguments
  • resource_id - The (local) resource ID of the topic to publish to.
  • call_options - Options to include in the published message.
  • payload - Payload to include in the published message.
§Errors

Returns an error if the message could not be published.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§