pub trait QueueHandle: Clone {
type Acker: Acker;
type Consumer<T: Serializable>: Stream<Item = (T, Self::Acker)>;
type Publisher<T: Serializable>: Publisher<T>;
// Required methods
fn publisher<PayloadTarget: Serializable>(
&self,
) -> Self::Publisher<PayloadTarget>;
fn declare_consumer<'life0, 'life1, 'async_trait, PayloadTarget>(
&'life0 self,
consumer_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Consumer<PayloadTarget>>> + Send + 'async_trait>>
where PayloadTarget: 'async_trait + Serializable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn publish<'life0, 'life1, 'async_trait, PayloadTarget>(
&'life0 self,
payload: &'life1 PayloadTarget,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self::Publisher<PayloadTarget>: Send,
PayloadTarget: 'async_trait + Serializable,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Expand description
A handle to a queue.
Handles should be cheap to clone such that references need not be passed around.
Required Associated Types§
type Acker: Acker
type Consumer<T: Serializable>: Stream<Item = (T, Self::Acker)>
type Publisher<T: Serializable>: Publisher<T>
Required Methods§
fn publisher<PayloadTarget: Serializable>( &self, ) -> Self::Publisher<PayloadTarget>
Sourcefn declare_consumer<'life0, 'life1, 'async_trait, PayloadTarget>(
&'life0 self,
consumer_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Consumer<PayloadTarget>>> + Send + 'async_trait>>where
PayloadTarget: 'async_trait + Serializable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn declare_consumer<'life0, 'life1, 'async_trait, PayloadTarget>(
&'life0 self,
consumer_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Self::Consumer<PayloadTarget>>> + Send + 'async_trait>>where
PayloadTarget: 'async_trait + Serializable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Declare a queue consumer.
Provided Methods§
fn publish<'life0, 'life1, 'async_trait, PayloadTarget>(
&'life0 self,
payload: &'life1 PayloadTarget,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self::Publisher<PayloadTarget>: Send,
PayloadTarget: 'async_trait + Serializable,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.