ProtoTrait

Trait ProtoTrait 

Source
pub trait ProtoTrait {
    type Response: ProtoTrait + Send + Serialize + DeserializeOwned + Debug;
    type Client;

    // Provided methods
    fn dispatch<'async_trait>(
        self,
        _request_id: u64,
        _client: Self::Client,
    ) -> Pin<Box<dyn Future<Output = Option<Self::Response>> + Send + 'async_trait>>
       where Self: Sized + Send + 'async_trait,
             Self::Client: Send { ... }
    fn from_bytes(bytes: &[u8]) -> Self
       where Self: Sized + DeserializeOwned { ... }
    fn to_bytes(&self) -> Vec<u8> 
       where Self: Sized + Serialize { ... }
}

Required Associated Types§

Provided Methods§

Source

fn dispatch<'async_trait>( self, _request_id: u64, _client: Self::Client, ) -> Pin<Box<dyn Future<Output = Option<Self::Response>> + Send + 'async_trait>>
where Self: Sized + Send + 'async_trait, Self::Client: Send,

Source

fn from_bytes(bytes: &[u8]) -> Self
where Self: Sized + DeserializeOwned,

Source

fn to_bytes(&self) -> Vec<u8>
where Self: Sized + Serialize,

Implementors§