Trait distant_net::server::Reply

source ·
pub trait Reply: Send + Sync {
    type Data;

    // Required methods
    fn send(
        &self,
        data: Self::Data
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
    fn blocking_send(&self, data: Self::Data) -> Result<()>;
    fn clone_reply(&self) -> Box<dyn Reply<Data = Self::Data>>;
}
Expand description

Interface to send a reply to some request

Required Associated Types§

Required Methods§

source

fn send( &self, data: Self::Data ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>

Sends a reply out from the server

source

fn blocking_send(&self, data: Self::Data) -> Result<()>

Blocking version of sending a reply out from the server

source

fn clone_reply(&self) -> Box<dyn Reply<Data = Self::Data>>

Clones this reply

Implementations on Foreign Types§

source§

impl<T: Send + 'static> Reply for Sender<T>

§

type Data = T

source§

fn send( &self, data: Self::Data ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>

source§

fn blocking_send(&self, data: Self::Data) -> Result<()>

source§

fn clone_reply(&self) -> Box<dyn Reply<Data = Self::Data>>

Implementors§

source§

impl<T: Send + 'static> Reply for QueuedServerReply<T>

§

type Data = T

source§

impl<T: Send + 'static> Reply for ServerReply<T>

§

type Data = T