pub trait HostMessage {
// Required methods
fn new<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Resource<Message>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn topic<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
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 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drop<'life0, 'async_trait>(
&'life0 mut self,
rep: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Required Methods§
fn new<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<Resource<Message>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn topic<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Option<Topic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn topic<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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, if any
Sourcefn content_type<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn data<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
data: 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,
self_: Resource<Message>,
data: 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 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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,
self_: Resource<Message>,
meta: Metadata,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the metadata
Sourcefn remove_metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
key: String,
) -> 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,
self_: Resource<Message>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove a key-value pair from the metadata
fn drop<'life0, 'async_trait>(
&'life0 mut self,
rep: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implementations on Foreign Types§
Source§impl<_T: HostMessage + ?Sized + Send> HostMessage for &mut _T
impl<_T: HostMessage + ?Sized + Send> HostMessage for &mut _T
Source§fn topic<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Option<Topic>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn topic<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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, if any
Source§fn content_type<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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 mut self,
self_: Resource<Message>,
) -> 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
Source§fn set_content_type<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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
Source§fn data<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn data<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
An opaque blob of data
Source§fn set_data<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
data: 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,
self_: Resource<Message>,
data: 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
Source§fn metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> Pin<Box<dyn Future<Output = Result<Option<Metadata>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
) -> 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.).
Source§fn add_metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
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,
self_: Resource<Message>,
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
Source§fn set_metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
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,
self_: Resource<Message>,
meta: Metadata,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the metadata
Source§fn remove_metadata<'life0, 'async_trait>(
&'life0 mut self,
self_: Resource<Message>,
key: String,
) -> 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,
self_: Resource<Message>,
key: String,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove a key-value pair from the metadata