Skip to main content

Output

Trait Output 

Source
pub trait Output<S>: Send {
    // Required method
    fn publish<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        snapshot: &'life1 S,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn hardware_status<'life0, 'async_trait>(
        &'life0 mut self,
        _status: HardwareStatus,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Output adapter for console, MQTT, or another telemetry transport.

Required Methods§

Source

fn publish<'life0, 'life1, 'async_trait>( &'life0 mut self, snapshot: &'life1 S, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn hardware_status<'life0, 'async_trait>( &'life0 mut self, _status: HardwareStatus, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S, A, B> Output<S> for EitherOutput<A, B>
where S: Send + Sync, A: Output<S>, B: Output<S>,

Source§

impl<S> Output<S> for ConsoleOutput
where S: Serialize + Send + Sync,

Source§

impl<S> Output<S> for MqttOutput
where S: Serialize + Send + Sync,