[−][src]Struct bmp_client::BmpClient
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
Auto Trait Implementations
impl !RefUnwindSafe for BmpClient
impl Send for BmpClient
impl Sync for BmpClient
impl Unpin for BmpClient
impl !UnwindSafe for BmpClient
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,