[][src]Trait misskey::prelude::StreamingClient

pub trait StreamingClient {
    type Error: Error;
    pub fn subnote<E>(
        &self,
        note_id: String
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<E, Self::Error>> + Send, Global>>, Self::Error>> + Send, Global>>
    where
        E: SubNoteEvent
;
pub fn channel<R>(
        &self,
        request: R
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn StreamSink<<R as ConnectChannelRequest>::Incoming, <R as ConnectChannelRequest>::Outgoing, Self::Error, Item = Result<<R as ConnectChannelRequest>::Incoming, Self::Error>, Error = Self::Error> + Send, Global>>, Self::Error>> + Send, Global>>
    where
        R: ConnectChannelRequest
;
pub fn broadcast<E>(
        &self
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<E, Self::Error>> + Send, Global>>, Self::Error>> + Send, Global>>
    where
        E: BroadcastEvent
; }

Abstraction over API clients with streaming connections.

Associated Types

type Error: Error[src]

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

Loading content...

Required methods

pub fn subnote<E>(
    &self,
    note_id: String
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<E, Self::Error>> + Send, Global>>, Self::Error>> + Send, Global>> where
    E: SubNoteEvent
[src]

Captures the note specified by note_id.

pub fn channel<R>(
    &self,
    request: R
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn StreamSink<<R as ConnectChannelRequest>::Incoming, <R as ConnectChannelRequest>::Outgoing, Self::Error, Item = Result<<R as ConnectChannelRequest>::Incoming, Self::Error>, Error = Self::Error> + Send, Global>>, Self::Error>> + Send, Global>> where
    R: ConnectChannelRequest
[src]

Connects to the channel using request.

pub fn broadcast<E>(
    &self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<E, Self::Error>> + Send, Global>>, Self::Error>> + Send, Global>> where
    E: BroadcastEvent
[src]

Receive messages from the broadcast stream.

Loading content...

Implementations on Foreign Types

impl<C> StreamingClient for Box<C, Global> where
    C: StreamingClient + ?Sized
[src]

type Error = <C as StreamingClient>::Error

impl<'_, C> StreamingClient for &'_ mut C where
    C: StreamingClient + ?Sized
[src]

type Error = <C as StreamingClient>::Error

impl<'_, C> StreamingClient for &'_ C where
    C: StreamingClient + ?Sized
[src]

type Error = <C as StreamingClient>::Error

Loading content...

Implementors

impl StreamingClient for WebSocketClient[src]

type Error = Error

Loading content...