Trait ClientStream

Source
pub trait ClientStream:
    Sized
    + Send
    + Sync {
    // Required methods
    fn request(&mut self, req: &[u8]) -> Result<Buffer, Error>;
    fn connect<P>(path: P) -> Result<AgentClient<Self>, Error>
       where P: AsRef<Path> + Send;

    // Provided method
    fn connect_env() -> Result<AgentClient<Self>, Error> { ... }
}

Required Methods§

Source

fn request(&mut self, req: &[u8]) -> Result<Buffer, Error>

Send an agent request through the stream and read the response.

Source

fn connect<P>(path: P) -> Result<AgentClient<Self>, Error>
where P: AsRef<Path> + Send,

How to connect the streaming socket

Provided Methods§

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.

Implementations on Foreign Types§

Source§

impl ClientStream for UnixStream

Source§

fn connect<P>(path: P) -> Result<AgentClient<Self>, Error>
where P: AsRef<Path> + Send,

Source§

fn request(&mut self, msg: &[u8]) -> Result<Buffer, Error>

Implementors§