Publisher

Trait Publisher 

Source
pub trait Publisher: Clone {
    type Error: Error;

    // Required method
    fn publish_with<P>(
        &self,
        publishable: P,
        options: PublishOptions,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send
       where P: Publishable + Send + 'static;

    // Provided method
    fn publish<P>(
        &self,
        publishable: P,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send
       where P: Publishable + Send + 'static { ... }
}
Expand description

Types which may publish publishable data.

Required Associated Types§

Source

type Error: Error

Error type related to a failed publish.

Required Methods§

Source

fn publish_with<P>( &self, publishable: P, options: PublishOptions, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where P: Publishable + Send + 'static,

Publish the publishable structure with PublishOptions overriding all other options, including the Publishable::publish_overrides(). If no options are provided, fallback options shall be used.

Provided Methods§

Source

fn publish<P>( &self, publishable: P, ) -> impl Future<Output = Result<(), Self::Error>> + Send
where P: Publishable + Send + 'static,

Publish the publishable structure without overriding PublishOptions.

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.

Implementors§