Trait Backend

Source
pub trait Backend {
    type Output;
    type Error: Error + 'static + Send;

    // Required method
    fn create(
        host: &str,
        name: &str,
        send: Sender<Result<NtMessage, Error>>,
        receive: Receiver<NtMessage>,
    ) -> Result<Self::Output, Self::Error>;
}
Expand description

A generic backend that a client can use. backend::TokioBackend is a good example.

Required Associated Types§

Source

type Output

A type like a join handle that whatever is using the client might need

Source

type Error: Error + 'static + Send

Required Methods§

Source

fn create( host: &str, name: &str, send: Sender<Result<NtMessage, Error>>, receive: Receiver<NtMessage>, ) -> Result<Self::Output, Self::Error>

Using the hostname and client name create a backend that sends NtMessage or [Error] to the client and passes on NtMessage to the server

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§