Trait pliantdb_local::core::pubsub::PubSub [−][src]
pub trait PubSub { type Subscriber: Subscriber; #[must_use] pub fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + 'async_trait + Send, Global>>
where
'life0: 'async_trait,
Self: 'async_trait; #[must_use] pub fn publish<'life0, 'life1, 'async_trait, S, P>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
S: Into<String> + Send + 'async_trait,
P: Serialize + Sync + 'async_trait; #[must_use] pub fn publish_to_all<'life0, 'life1, 'async_trait, P>(
&'life0 self,
topics: Vec<String, Global>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
P: Serialize + Sync + 'async_trait; }
Publishes and Subscribes to messages on topics.
Associated Types
type Subscriber: Subscriber
[src]
The Subscriber type for this PubSub
connection.
Required methods
#[must_use]pub fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
#[must_use]
pub fn create_subscriber<'life0, 'async_trait>(&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a new Subscriber
for this relay.
#[must_use]pub fn publish<'life0, 'life1, 'async_trait, S, P>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
S: Into<String> + Send + 'async_trait,
P: Serialize + Sync + 'async_trait,
[src]
#[must_use]
pub fn publish<'life0, 'life1, 'async_trait, S, P>(&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
S: Into<String> + Send + 'async_trait,
P: Serialize + Sync + 'async_trait,
Publishes a payload
to all subscribers of topic
.
#[must_use]pub fn publish_to_all<'life0, 'life1, 'async_trait, P>(
&'life0 self,
topics: Vec<String, Global>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
P: Serialize + Sync + 'async_trait,
[src]
#[must_use]
pub fn publish_to_all<'life0, 'life1, 'async_trait, P>(&'life0 self,
topics: Vec<String, Global>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
P: Serialize + Sync + 'async_trait,
Publishes a payload
to all subscribers of all topics
.
Implementors
impl PubSub for Relay
[src]
impl PubSub for Relay
[src]type Subscriber = Subscriber
pub fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<<Relay as PubSub>::Subscriber, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Relay: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<<Relay as PubSub>::Subscriber, Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
Relay: 'async_trait,
pub fn publish<'life0, 'life1, 'async_trait, S, P>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
S: Into<String> + Send + 'async_trait,
P: Serialize + Sync + 'async_trait,
Relay: 'async_trait,
[src]
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
S: Into<String> + Send + 'async_trait,
P: Serialize + Sync + 'async_trait,
Relay: 'async_trait,
pub fn publish_to_all<'life0, 'life1, 'async_trait, P>(
&'life0 self,
topics: Vec<String, Global>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
P: Serialize + Sync + 'async_trait,
Relay: 'async_trait,
[src]
&'life0 self,
topics: Vec<String, Global>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait + Send, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
P: Serialize + Sync + 'async_trait,
Relay: 'async_trait,
impl<DB> PubSub for Database<DB> where
DB: Schema,
[src]
impl<DB> PubSub for Database<DB> where
DB: Schema,
[src]type Subscriber = Subscriber
fn create_subscriber<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn publish<'life0, 'life1, 'async_trait, S: Into<String> + Send, P: Serialize + Sync>(
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
S: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
topic: S,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
S: 'async_trait,
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn publish_to_all<'life0, 'life1, 'async_trait, P: Serialize + Sync>(
&'life0 self,
topics: Vec<String>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
topics: Vec<String>,
payload: &'life1 P
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
P: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,