[−][src]Struct candid_client::candid_connection::CandidConnection
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.
Methods
impl CandidConnection
[src]
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<Frame, Error>
[src]
Reads a single CAN frame sent by the server.
pub fn write_frame(&mut self, frame: Frame) -> Result<(), Error>
[src]
Sends a frame to 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
.
Auto Trait Implementations
impl Send for CandidConnection
impl Sync for CandidConnection
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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> 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,