pub struct SwitchPublisher { /* private fields */ }Implementations§
Source§impl SwitchPublisher
impl SwitchPublisher
pub fn new( metadata_key: String, cases: HashMap<String, Arc<dyn MessagePublisher>>, default: Option<Arc<dyn MessagePublisher>>, ) -> Self
Trait Implementations§
Source§impl MessagePublisher for SwitchPublisher
impl MessagePublisher for SwitchPublisher
fn send<'life0, 'async_trait>(
&'life0 self,
message: CanonicalMessage,
) -> Pin<Box<dyn Future<Output = Result<Sent, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn send_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<CanonicalMessage>,
) -> Pin<Box<dyn Future<Output = Result<SentBatch, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_batch<'life0, 'async_trait>(
&'life0 self,
messages: Vec<CanonicalMessage>,
) -> Pin<Box<dyn Future<Output = Result<SentBatch, PublisherError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a batch of messages. Read more
fn as_any(&self) -> &dyn Any
Source§fn on_connect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
fn on_connect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
Returns an optional lifecycle hook that runs once after the publisher connection is created. Read more
Source§fn on_disconnect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
fn on_disconnect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
Returns an optional lifecycle hook that runs before the publisher is dropped. Read more
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EndpointStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SwitchPublisher
impl !UnwindSafe for SwitchPublisher
impl Freeze for SwitchPublisher
impl Send for SwitchPublisher
impl Sync for SwitchPublisher
impl Unpin for SwitchPublisher
impl UnsafeUnpin for SwitchPublisher
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