Originator

Trait Originator 

Source
pub trait Originator:
    Clone
    + Send
    + 'static {
    type PublicKey: PublicKey;
    type Request: Committable + Digestible + Codec;

    // Required methods
    fn send(
        &mut self,
        recipients: Recipients<Self::PublicKey>,
        request: Self::Request,
    ) -> impl Future<Output = Vec<Self::PublicKey>> + Send;
    fn cancel(
        &mut self,
        commitment: <Self::Request as Committable>::Commitment,
    ) -> impl Future<Output = ()> + Send;
}
Expand description

An Originator sends requests out to a set of Handlers and collects replies.

Required Associated Types§

Source

type PublicKey: PublicKey

The PublicKey of a recipient.

Source

type Request: Committable + Digestible + Codec

The type of request to send.

Required Methods§

Source

fn send( &mut self, recipients: Recipients<Self::PublicKey>, request: Self::Request, ) -> impl Future<Output = Vec<Self::PublicKey>> + Send

Sends a Request to a set of Recipients, returning the list of handlers that we tried to send to.

Source

fn cancel( &mut self, commitment: <Self::Request as Committable>::Commitment, ) -> impl Future<Output = ()> + Send

Cancel a request by commitment, ignoring any future responses.

Tracked commitments are not removed until explicitly cancelled.

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§