Trait UpdateClient

Source
pub trait UpdateClient {
    type Request;
    type Update;
    type Response;
    type Error;

    // Required methods
    fn send_request(
        &mut self,
        request: Self::Request,
    ) -> Result<(), Self::Error>;
    fn poll_for_update(
        &mut self,
    ) -> Result<Option<(Self::Request, Self::Update)>, Self::Error>;
    fn poll_for_updates(
        &mut self,
    ) -> Vec<Result<(Self::Request, Self::Update), Self::Error>>;
    fn poll_for_response(
        &mut self,
    ) -> Result<Option<(Self::Request, Self::Response)>, Self::Error>;
    fn poll_for_responses(
        &mut self,
    ) -> Vec<Result<(Self::Request, Self::Response), Self::Error>>;
}
Expand description

A common abstraction for all NComm update clients

Required Associated Types§

Source

type Request

The type of data used as a request by the client

Source

type Update

The type of data used as an update from the server

Source

type Response

The type of data used as a response from the server

Source

type Error

The type of error from sending or receiving data from the update server

Required Methods§

Source

fn send_request(&mut self, request: Self::Request) -> Result<(), Self::Error>

Send a request to the server this client is associated with

Source

fn poll_for_update( &mut self, ) -> Result<Option<(Self::Request, Self::Update)>, Self::Error>

Poll for a singular update from the server

Source

fn poll_for_updates( &mut self, ) -> Vec<Result<(Self::Request, Self::Update), Self::Error>>

Poll for updates from the server

Source

fn poll_for_response( &mut self, ) -> Result<Option<(Self::Request, Self::Response)>, Self::Error>

Poll for a singular response from the server

Source

fn poll_for_responses( &mut self, ) -> Vec<Result<(Self::Request, Self::Response), Self::Error>>

Poll for responses from the server

Implementors§