[][src]Struct candid_client::candid_connection::CandidConnection

pub struct CandidConnection { /* fields omitted */ }

Methods

impl CandidConnection[src]

A connection to a CANdid server. Simply contains a TcpStream wrapped by a BufReader. Handles the communication with a server by reading one can frame at a time from a TCP stream.

pub fn new<A: ToSocketAddrs>(addr: A) -> Result<CandidConnection, Error>[src]

Creates a new CandidConnection with a server designated at addr

pub fn read_frame(&mut self) -> Result<String, Error>[src]

Reads a single CAN frame sent by the server.

pub fn into_raw_stream(self) -> TcpStream[src]

Unwraps the internal BufReader and returns the raw TcpStream.

Note that any leftover data in the buffer will be lost.

pub fn into_buffer(self) -> BufReader<TcpStream>[src]

Unwraps this CandidConnection and returns the underlying BufReader.

pub fn lines(self) -> Lines<BufReader<TcpStream>>[src]

Returns an iterator over the raw lines form the underlying TcpStream.

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]