[][src]Struct bmp_client::BmpClient

pub struct BmpClient { /* fields omitted */ }

BmpClient

Holds the TcpStream and Decoder state

let client = BmpClient::new(tcp_stream)?;
let decoded_message = client.recv()?;

Implementations

impl BmpClient[src]

pub fn new(stream: TcpStream) -> Self[src]

Instantiate a new client

pub async fn recv<'_>(&'_ mut self) -> Option<Result<BmpMessage, Error>>[src]

Returns a Future that will resolve to the next message

Returns an error if the client disconnects or if there is an error decoding the message

pub fn connected(&self) -> Duration[src]

Return a Duration representing how long this client has been connected

pub fn messages(&self) -> usize[src]

Return the number of messages received from this client during the active session

Trait Implementations

impl Debug for BmpClient[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, 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.