pub struct DirectChannel { /* private fields */ }Expand description
Direct, synchronous handoff channel.
No internal buffering: send immediately dispatches the exchange to all subscribers in registration order. Each subscriber receives a cloned Exchange.
Implementations§
Source§impl DirectChannel
impl DirectChannel
Sourcepub fn with_random_id() -> DirectChannel
pub fn with_random_id() -> DirectChannel
Create a new direct channel with an auto-generated UUID-based id (direct:<uuid>).
Sourcepub fn with_id<S>(id: S) -> DirectChannel
pub fn with_id<S>(id: S) -> DirectChannel
Create a new direct channel with an explicit id.
Sourcepub fn with_subscribers<I, F>(id: Option<&str>, subs: I) -> DirectChannel
pub fn with_subscribers<I, F>(id: Option<&str>, subs: I) -> DirectChannel
Convenience: construct with optional id and an initial iterator of subscribers. Each provided closure is subscribed in iteration order.
Trait Implementations§
Source§impl Channel for DirectChannel
impl Channel for DirectChannel
fn id(&self) -> &str
fn send<'life0, 'async_trait>(
&'life0 self,
exchange: Exchange,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
DirectChannel: 'async_trait,
fn kind(&self) -> &'static str
fn as_any(&self) -> &(dyn Any + 'static)
Source§impl Debug for DirectChannel
impl Debug for DirectChannel
Auto Trait Implementations§
impl !Freeze for DirectChannel
impl RefUnwindSafe for DirectChannel
impl Send for DirectChannel
impl Sync for DirectChannel
impl Unpin for DirectChannel
impl UnwindSafe for DirectChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more