Trait brw::reader::Reader[][src]

pub trait Reader: Sized {
    type BrokerItem: Send + 'static;
    type Ok: Send;
    type Error: Error + Send;
    fn op<'life0, 'async_trait, B>(
        &'life0 mut self,
        broker: B
    ) -> Pin<Box<dyn Future<Output = Running<Result<Self::Ok, Self::Error>, Option<Self::Error>>> + Send + 'async_trait>>
    where
        B: Sink<Self::BrokerItem, Error = SendError<Self::BrokerItem>> + Send + Unpin,
        B: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; fn handle_result<'async_trait>(
        res: Result<Self::Ok, Self::Error>
    ) -> Pin<Box<dyn Future<Output = Running<(), Option<Self::Error>>> + Send + 'async_trait>>
    where
        Self: Send + 'async_trait
, { ... }
fn reader_loop<'async_trait, B>(
        self,
        ctx: Arc<Context<Self::BrokerItem>>,
        broker: B,
        stop: Receiver<()>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    where
        B: Sink<Self::BrokerItem, Error = SendError<Self::BrokerItem>> + Send + Unpin,
        B: 'async_trait,
        Self: Send + 'async_trait
, { ... } }
Expand description

Reader of the broker-reader-writer pattern

Associated Types

Item to send to broker

Ok result from op

Error result from op

Required methods

The operation to perform

Provided methods

Handles the result of each op

Returns a None to stop the whole loop

Runs the operation in a loop

Implementors