Endpoint

Trait Endpoint 

Source
pub trait Endpoint<RecvMsg, SendMsg>: Send + Sync
where RecvMsg: Send + 'static, SendMsg: Send + 'static,
{ // Required methods fn recv<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<RecvMsg>, TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send<'life0, 'async_trait>( &'life0 self, item: SendMsg, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

Generic endpoint view.

A caller only needs recv/send from one side; direction is encoded at type-level by RecvMsg and SendMsg.

Required Methods§

Source

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

Source

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

Source

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

Implementors§

Source§

impl Endpoint<AgentEvent, RuntimeInput> for RuntimeEndpoint

Source§

impl<R, SendMsg> Endpoint<<R as Transcoder>::Output, SendMsg> for TranscoderEndpoint<R, SendMsg>
where R: Transcoder + 'static, SendMsg: Send + 'static,

Source§

impl<SendMsg> Endpoint<RuntimeInput, SendMsg> for HttpSseServerEndpoint<SendMsg>
where SendMsg: Serialize + Send + 'static,