pub trait MessagingHostMessage0_3 {
// Required methods
fn topic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Topic>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn content_type<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_content_type<'life0, 'async_trait>(
&'life0 mut self,
content_type: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_data<'life0, 'async_trait>(
&'life0 mut self,
buf: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_metadata<'life0, 'async_trait>(
&'life0 mut self,
key: String,
value: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_metadata<'life0, 'async_trait>(
&'life0 mut self,
meta: Metadata,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_metadata<'life0, 'async_trait>(
&'life0 mut self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn as_any(&self) -> &dyn Any;
fn into_any(self: Box<Self>) -> Box<dyn Any>;
}
Expand description
A message with a binary payload and additional information
Required Methods§
sourcefn topic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Topic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn topic<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Topic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The topic/subject/channel this message was received on
sourcefn content_type<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn content_type<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
An optional content-type describing the format of the data in the message. This is sometimes described as the “format” type
sourcefn set_content_type<'life0, 'async_trait>(
&'life0 mut self,
content_type: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_content_type<'life0, 'async_trait>(
&'life0 mut self,
content_type: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the content-type describing the format of the data in the message. This is sometimes described as the “format” type
sourcefn data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
An opaque blob of data
sourcefn set_data<'life0, 'async_trait>(
&'life0 mut self,
buf: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_data<'life0, 'async_trait>(
&'life0 mut self,
buf: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the opaque blob of data for this message, discarding the old value
sourcefn metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional metadata (also called headers or attributes in some systems) attached to the message. This metadata is simply decoration and should not be interpreted by a host to ensure portability across different implementors (e.g., Kafka -> NATS, etc.).
sourcefn add_metadata<'life0, 'async_trait>(
&'life0 mut self,
key: String,
value: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_metadata<'life0, 'async_trait>(
&'life0 mut self,
key: String,
value: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a new key-value pair to the metadata, overwriting any existing value for the same key
sourcefn set_metadata<'life0, 'async_trait>(
&'life0 mut self,
meta: Metadata,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_metadata<'life0, 'async_trait>(
&'life0 mut self,
meta: Metadata,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the metadata