StreamingClient

Trait StreamingClient 

Source
pub trait StreamingClient {
    type Error: Error;

    // Required methods
    fn subnote<E: SubNoteEvent>(
        &self,
        note_id: String,
    ) -> BoxFuture<'_, Result<SubNoteStream<'_, E, Self::Error>, Self::Error>>;
    fn channel<R: ConnectChannelRequest>(
        &self,
        request: R,
    ) -> BoxFuture<'_, Result<ChannelStream<'_, R, Self::Error>, Self::Error>>;
    fn broadcast<E: BroadcastEvent>(
        &self,
    ) -> BoxFuture<'_, Result<BroadcastStream<'_, E, Self::Error>, Self::Error>>;
}
Expand description

Abstraction over API clients with streaming connections.

Required Associated Types§

Source

type Error: Error

The error type produced by the client when an error occurs.

Required Methods§

Source

fn subnote<E: SubNoteEvent>( &self, note_id: String, ) -> BoxFuture<'_, Result<SubNoteStream<'_, E, Self::Error>, Self::Error>>

Captures the note specified by note_id.

Source

fn channel<R: ConnectChannelRequest>( &self, request: R, ) -> BoxFuture<'_, Result<ChannelStream<'_, R, Self::Error>, Self::Error>>

Connects to the channel using request.

Source

fn broadcast<E: BroadcastEvent>( &self, ) -> BoxFuture<'_, Result<BroadcastStream<'_, E, Self::Error>, Self::Error>>

Receive messages from the broadcast stream.

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.

Implementations on Foreign Types§

Source§

impl<C> StreamingClient for &C
where C: StreamingClient + ?Sized,

Source§

type Error = <C as StreamingClient>::Error

Source§

fn subnote<E: SubNoteEvent>( &self, note_id: String, ) -> BoxFuture<'_, Result<SubNoteStream<'_, E, Self::Error>, Self::Error>>

Source§

fn channel<R: ConnectChannelRequest>( &self, request: R, ) -> BoxFuture<'_, Result<ChannelStream<'_, R, Self::Error>, Self::Error>>

Source§

fn broadcast<E: BroadcastEvent>( &self, ) -> BoxFuture<'_, Result<BroadcastStream<'_, E, Self::Error>, Self::Error>>

Source§

impl<C> StreamingClient for &mut C
where C: StreamingClient + ?Sized,

Source§

type Error = <C as StreamingClient>::Error

Source§

fn subnote<E: SubNoteEvent>( &self, note_id: String, ) -> BoxFuture<'_, Result<SubNoteStream<'_, E, Self::Error>, Self::Error>>

Source§

fn channel<R: ConnectChannelRequest>( &self, request: R, ) -> BoxFuture<'_, Result<ChannelStream<'_, R, Self::Error>, Self::Error>>

Source§

fn broadcast<E: BroadcastEvent>( &self, ) -> BoxFuture<'_, Result<BroadcastStream<'_, E, Self::Error>, Self::Error>>

Source§

impl<C> StreamingClient for Box<C>
where C: StreamingClient + ?Sized,

Source§

type Error = <C as StreamingClient>::Error

Source§

fn subnote<E: SubNoteEvent>( &self, note_id: String, ) -> BoxFuture<'_, Result<SubNoteStream<'_, E, Self::Error>, Self::Error>>

Source§

fn channel<R: ConnectChannelRequest>( &self, request: R, ) -> BoxFuture<'_, Result<ChannelStream<'_, R, Self::Error>, Self::Error>>

Source§

fn broadcast<E: BroadcastEvent>( &self, ) -> BoxFuture<'_, Result<BroadcastStream<'_, E, Self::Error>, Self::Error>>

Implementors§