pub struct Slice<'a> { /* private fields */ }Expand description
A checked cursor retaining its complete initialized output slice.
Implementations§
Source§impl<'a> Slice<'a>
impl<'a> Slice<'a>
pub fn new(out: &'a mut [u8]) -> Self
pub fn finish(self) -> usize
pub const fn remaining(&self) -> usize
Sourcepub fn into_mut(self) -> &'a mut [u8] ⓘ
pub fn into_mut(self) -> &'a mut [u8] ⓘ
Returns exactly the written prefix under the original exclusive borrow.
Sourcepub fn try_complete(self) -> Result<(), Error>
pub fn try_complete(self) -> Result<(), Error>
Succeeds only after the complete original output slice was written.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Send for Slice<'a>
impl<'a> !Sync for Slice<'a>
impl<'a> !UnwindSafe for Slice<'a>
impl<'a> Freeze for Slice<'a>
impl<'a> RefUnwindSafe for Slice<'a>
impl<'a> Unpin for Slice<'a>
impl<'a> UnsafeUnpin for Slice<'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