pub struct SliceOutputTarget<'a> { /* private fields */ }Expand description
A wrapper around a &mut [u8] that implements OutputTarget.
Trait Implementations§
Source§impl<'a> Debug for SliceOutputTarget<'a>
impl<'a> Debug for SliceOutputTarget<'a>
Source§impl<'a> From<&'a mut [u8]> for SliceOutputTarget<'a>
impl<'a> From<&'a mut [u8]> for SliceOutputTarget<'a>
Source§fn from(value: &'a mut [u8]) -> Self
fn from(value: &'a mut [u8]) -> Self
Creates a new SliceOutputTarget that wraps the provided buffer.
Source§impl OutputTarget for SliceOutputTarget<'_>
impl OutputTarget for SliceOutputTarget<'_>
Source§fn remaining(&self) -> usize
fn remaining(&self) -> usize
Returns the number of unwritten bytes currently remaining in the target. Read more
Source§fn write_byte(&mut self, byte: u8) -> Result<()>
fn write_byte(&mut self, byte: u8) -> Result<()>
Attempts to write the provided byte into this target.
Source§fn write_bytes_exact(&mut self, bytes: &[u8]) -> Result<()>
fn write_bytes_exact(&mut self, bytes: &[u8]) -> Result<()>
Attempts to write the provided bytes into this target. Read more
Source§fn write_bytes_into_reserved_exact(
&mut self,
reservation: &mut Reservation,
bytes: &[u8],
) -> Result<()>
fn write_bytes_into_reserved_exact( &mut self, reservation: &mut Reservation, bytes: &[u8], ) -> Result<()>
Attempts to write the provided bytes into a reserved chunk of memory within this target. Read more
Source§fn reserve_space(&mut self, count: usize) -> Result<Reservation>
fn reserve_space(&mut self, count: usize) -> Result<Reservation>
Reserves a chunk of memory in the target that can be written to later, and advances past it. Read more
Auto Trait Implementations§
impl<'a> Freeze for SliceOutputTarget<'a>
impl<'a> RefUnwindSafe for SliceOutputTarget<'a>
impl<'a> Send for SliceOutputTarget<'a>
impl<'a> Sync for SliceOutputTarget<'a>
impl<'a> Unpin for SliceOutputTarget<'a>
impl<'a> UnsafeUnpin for SliceOutputTarget<'a>
impl<'a> !UnwindSafe for SliceOutputTarget<'a>
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