pub struct AsyncStream<const N: usize> { /* private fields */ }Expand description
Async wrapper around an ove::Stream.
Owns the wrapped stream and the AtomicWaker used to bridge the
C-level notify hook into the embassy executor’s wake path.
Implementations§
Source§impl<const N: usize> AsyncStream<N>
impl<const N: usize> AsyncStream<N>
Sourcepub const fn new(inner: Stream<N>) -> Self
pub const fn new(inner: Stream<N>) -> Self
Wrap a stream for async use. Does not arm the notify hook yet —
call Self::arm after the wrapper has reached its final
’static location (the C callback retains a pointer to the
internal AtomicWaker, so the wrapper must not move after
arming).
Sourcepub fn arm(&'static self) -> Result<()>
pub fn arm(&'static self) -> Result<()>
Register the C-side notify callback. Must be called exactly once, and only after the wrapper is at its final ’static address.
Trait Implementations§
Source§impl<const N: usize> ErrorType for &'static AsyncStream<N>
impl<const N: usize> ErrorType for &'static AsyncStream<N>
Source§impl<const N: usize> Read for &'static AsyncStream<N>
impl<const N: usize> Read for &'static AsyncStream<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>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf. Read moreimpl<const N: usize> Send for AsyncStream<N>
impl<const N: usize> Sync for AsyncStream<N>
Auto Trait Implementations§
impl<const N: usize> !Freeze for AsyncStream<N>
impl<const N: usize> !RefUnwindSafe for AsyncStream<N>
impl<const N: usize> Unpin for AsyncStream<N>
impl<const N: usize> UnsafeUnpin for AsyncStream<N>
impl<const N: usize> UnwindSafe for AsyncStream<N>
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