pub struct TcpStreamReadHalf { /* private fields */ }Expand description
Simple implementation of a TCP Stream Read Half
Allows for the passing of the read half being passed into a different thread seperate to the write half. Will be dropped if the Write Half is dropped.
Implementations§
Source§impl TcpStreamReadHalf
impl TcpStreamReadHalf
Sourcepub fn new(
io: FramedRead<ReadHalf<TokioTcpStream>, DoipCodec>,
config: Option<SocketConfig>,
) -> Self
pub fn new( io: FramedRead<ReadHalf<TokioTcpStream>, DoipCodec>, config: Option<SocketConfig>, ) -> Self
Creates a new TCP Stream Read Half from an existing Tokio TCP Stream and config
Sourcepub async fn read(&mut self) -> Option<Result<DoipMessage, DecodeError>>
pub async fn read(&mut self) -> Option<Result<DoipMessage, DecodeError>>
Read from the stream
Auto Trait Implementations§
impl Freeze for TcpStreamReadHalf
impl RefUnwindSafe for TcpStreamReadHalf
impl Send for TcpStreamReadHalf
impl Sync for TcpStreamReadHalf
impl Unpin for TcpStreamReadHalf
impl UnwindSafe for TcpStreamReadHalf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more