Struct embassy_sync::pipe::Reader
source · [−]Expand description
Read-only access to a Pipe
.
Implementations
sourceimpl<'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>ⓘNotable traits for ReadFuture<'p, M, N>impl<'p, M, const N: usize> Future for ReadFuture<'p, M, N>where
M: RawMutex, type Output = usize;
pub fn read<'a>(&'a self, buf: &'a mut [u8]) -> ReadFuture<'a, M, N>ⓘNotable traits for ReadFuture<'p, M, N>impl<'p, M, const N: usize> Future for ReadFuture<'p, M, N>where
M: RawMutex, type Output = usize;
M: RawMutex, type Output = usize;
Reads a value.
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 a message.
See Pipe::read()
Trait Implementations
sourceimpl<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.
sourceimpl<M: RawMutex, const N: usize> Read for Reader<'_, M, N>
impl<M: RawMutex, const N: usize> Read for Reader<'_, M, N>
type ReadFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <Reader<'_, M, N> as Io>::Error>> + 'a
type ReadFuture<'a>
where
Self: 'a = impl Future<Output = Result<usize, <Reader<'_, M, N> as Io>::Error>> + 'a
Future returned by
read
.sourcefn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>
Pull some bytes from this source into the specified buffer, returning how many bytes were read.
sourcefn read_exact(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> + 'a
fn read_exact(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> + 'a
Read the exact number of bytes required to fill
buf
.impl<'p, M: Copy, const N: usize> Copy for Reader<'p, M, N>where
M: RawMutex,
Auto Trait Implementations
impl<'p, M, const N: usize> !RefUnwindSafe for Reader<'p, M, N>
impl<'p, M, const N: usize> Send for Reader<'p, M, N>where
M: Sync,
impl<'p, M, const N: usize> Sync for Reader<'p, M, N>where
M: Sync,
impl<'p, M, const N: usize> Unpin for Reader<'p, M, N>
impl<'p, M, const N: usize> !UnwindSafe for Reader<'p, M, N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more