pub struct MessageReader<TRead: Read + Unpin> { /* private fields */ }Implementations§
Source§impl<TRead: Read + Unpin> MessageReader<TRead>
impl<TRead: Read + Unpin> MessageReader<TRead>
Sourcepub fn new(reader: TRead) -> Self
pub fn new(reader: TRead) -> Self
Creates a reader for messages from the provided reader.
The reader must only write to the buffers passed to Read::read and
never read from them, which is the case for pipes such as ChildStdout
and Stdin. See read_exact_into_uninit for why.
Sourcepub fn read_sized_bytes(&mut self) -> Result<Vec<u8>>
pub fn read_sized_bytes(&mut self) -> Result<Vec<u8>>
Reads a u32 value followed by a buffer.
pub fn read_bytes(&mut self, size: usize) -> Result<Vec<u8>>
pub fn read_success_bytes(&mut self) -> Result<()>
Auto Trait Implementations§
impl<TRead> Forget for MessageReader<TRead>
impl<TRead> Freeze for MessageReader<TRead>where
TRead: Freeze,
impl<TRead> Move for MessageReader<TRead>
impl<TRead> RefUnwindSafe for MessageReader<TRead>where
TRead: RefUnwindSafe,
impl<TRead> Send for MessageReader<TRead>where
TRead: Send,
impl<TRead> Sync for MessageReader<TRead>where
TRead: Sync,
impl<TRead> Unpin for MessageReader<TRead>
impl<TRead> UnsafeUnpin for MessageReader<TRead>where
TRead: UnsafeUnpin,
impl<TRead> UnwindSafe for MessageReader<TRead>where
TRead: UnwindSafe,
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