[−][src]Struct candid_client::candid_connection::CandidConnection
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
impl Send for CandidConnection
impl Sync for CandidConnection
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,