[][src]Struct rust_agent_sdk::Connection

pub struct Connection { /* fields omitted */ }

Send and receive Frame values from a remote peer.

When implementing networking protocols, a message on that protocol is often composed of several smaller messages known as frames. The purpose of Connection is to read and write frames on the underlying WsStream.

To read frames, the Connection uses an internal buffer, which is filled up until there are enough bytes to create a full frame. Once this happens, the Connection creates the frame and returns it to the caller.

When sending frames, the frame is first encoded into the write buffer. The contents of the write buffer are then written to the socket.

Implementations

impl Connection[src]

pub fn new(socket: TcpStream) -> Connection[src]

Create a new Connection, backed by socket. Read and write buffers are initialized.

Trait Implementations

impl Debug for Connection[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> WithSubscriber for T[src]