Struct embassy_sync::pipe::Reader
source · pub struct Reader<'p, M, const N: usize>where
M: RawMutex,{ /* private fields */ }
Expand description
Read-only access to a Pipe
.
Implementations§
source§impl<'p, M, const N: usize> Reader<'p, M, N>where
M: RawMutex,
impl<'p, M, const N: usize> Reader<'p, M, N>where M: RawMutex,
sourcepub fn read<'a>(&'a self, buf: &'a mut [u8]) -> ReadFuture<'a, M, N> ⓘ
pub fn read<'a>(&'a self, buf: &'a mut [u8]) -> ReadFuture<'a, M, N> ⓘ
Read some bytes from the pipe.
See Pipe::read()
sourcepub fn try_read(&self, buf: &mut [u8]) -> Result<usize, TryReadError>
pub fn try_read(&self, buf: &mut [u8]) -> Result<usize, TryReadError>
Attempt to immediately read some bytes from the pipe.
See Pipe::try_read()
Trait Implementations§
source§impl<M: RawMutex, const N: usize> Io for Reader<'_, M, N>
impl<M: RawMutex, const N: usize> Io for Reader<'_, M, N>
§type Error = Infallible
type Error = Infallible
Error type of all the IO operations on this type.
source§impl<M: RawMutex, const N: usize> Read for Reader<'_, M, N>
impl<M: RawMutex, const N: usize> Read for Reader<'_, M, N>
source§async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error>
Pull some bytes from this source into the specified buffer, returning how many bytes were read.
source§async fn read_exact(
&mut self,
buf: &mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
async fn read_exact( &mut self, buf: &mut [u8] ) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
Read the exact number of bytes required to fill
buf
.