pub struct FramedWriter<W: AsyncWrite + Unpin> { /* private fields */ }Expand description
Async writer that frames Crous data into blocks over a Tokio stream.
Implementations§
Source§impl<W: AsyncWrite + Unpin> FramedWriter<W>
impl<W: AsyncWrite + Unpin> FramedWriter<W>
pub fn new(writer: W) -> Self
pub fn with_flags(writer: W, flags: u8) -> Self
Sourcepub async fn write_block(&mut self, block: &[u8]) -> Result<()>
pub async fn write_block(&mut self, block: &[u8]) -> Result<()>
Write a pre-built block.
Sourcepub async fn write_data(&mut self, payload: &[u8]) -> Result<()>
pub async fn write_data(&mut self, payload: &[u8]) -> Result<()>
Write a raw data payload as a framed block.
Sourcepub fn into_inner(self) -> W
pub fn into_inner(self) -> W
Consume the writer and return the inner stream.
Auto Trait Implementations§
impl<W> Freeze for FramedWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for FramedWriter<W>where
W: RefUnwindSafe,
impl<W> Send for FramedWriter<W>where
W: Send,
impl<W> Sync for FramedWriter<W>where
W: Sync,
impl<W> Unpin for FramedWriter<W>
impl<W> UnsafeUnpin for FramedWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for FramedWriter<W>where
W: 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