pub struct SliceScopedUnchecked<'a, 'b, T> { /* private fields */ }Expand description
Implementations§
Source§impl<'b, T> SliceScopedUnchecked<'_, 'b, T>
impl<'b, T> SliceScopedUnchecked<'_, 'b, T>
Sourcepub const unsafe fn new(buf: &'b [T]) -> Self
pub const unsafe fn new(buf: &'b [T]) -> Self
Create a new SliceScopedUnchecked from the given slice.
§Safety
SliceScopedUnchecked’s implementation of Reader will not perform any
bounds checks on the slice. It is up to the caller to ensure that any
Reader operations performed are within the bounds of the slice.
Trait Implementations§
Source§impl<'a> Reader<'a> for SliceScopedUnchecked<'a, '_, u8>
impl<'a> Reader<'a> for SliceScopedUnchecked<'a, '_, u8>
Source§const BORROW_KINDS: u8
const BORROW_KINDS: u8
Borrow capabilities of this reader. Read more
Source§fn copy_into_slice(&mut self, dst: &mut [u8]) -> ReadResult<()>
fn copy_into_slice(&mut self, dst: &mut [u8]) -> ReadResult<()>
Attempts to copy and consume exactly
dst.len() bytes. Read moreSource§fn copy_into_uninit_slice(
&mut self,
dst: &mut [MaybeUninit<u8>],
) -> ReadResult<()>
fn copy_into_uninit_slice( &mut self, dst: &mut [MaybeUninit<u8>], ) -> ReadResult<()>
Attempts to copy and consume exactly
dst.len() bytes into potentially
uninitialized storage. Read moreSource§fn take_array<const N: usize>(&mut self) -> ReadResult<[u8; N]>
fn take_array<const N: usize>(&mut self) -> ReadResult<[u8; N]>
Source§fn take_scoped(&mut self, len: usize) -> ReadResult<&[u8]>
fn take_scoped(&mut self, len: usize) -> ReadResult<&[u8]>
Source§fn supports_borrow(&self, kind: BorrowKind) -> bool
fn supports_borrow(&self, kind: BorrowKind) -> bool
Checks if this reader supports the given borrow kind. Read more
Source§fn take_borrowed(&mut self, len: usize) -> ReadResult<&'a [u8]>
fn take_borrowed(&mut self, len: usize) -> ReadResult<&'a [u8]>
Source§fn take_borrowed_mut(&mut self, len: usize) -> ReadResult<&'a mut [u8]>
fn take_borrowed_mut(&mut self, len: usize) -> ReadResult<&'a mut [u8]>
Source§unsafe fn as_trusted_for(
&mut self,
n_bytes: usize,
) -> ReadResult<impl Reader<'a>>
unsafe fn as_trusted_for( &mut self, n_bytes: usize, ) -> ReadResult<impl Reader<'a>>
Source§unsafe fn as_trusted_for_seq(
&mut self,
len: usize,
size: usize,
) -> Result<impl Reader<'a>, ReadError>
unsafe fn as_trusted_for_seq( &mut self, len: usize, size: usize, ) -> Result<impl Reader<'a>, ReadError>
Source§unsafe fn copy_into_t<T>(&mut self, dst: &mut MaybeUninit<T>) -> ReadResult<()>
unsafe fn copy_into_t<T>(&mut self, dst: &mut MaybeUninit<T>) -> ReadResult<()>
Source§unsafe fn copy_into_slice_t<T>(
&mut self,
dst: &mut [MaybeUninit<T>],
) -> ReadResult<()>
unsafe fn copy_into_slice_t<T>( &mut self, dst: &mut [MaybeUninit<T>], ) -> ReadResult<()>
Auto Trait Implementations§
impl<'a, 'b, T> Freeze for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> RefUnwindSafe for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> Send for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> Sync for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> Unpin for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> UnsafeUnpin for SliceScopedUnchecked<'a, 'b, T>
impl<'a, 'b, T> UnwindSafe for SliceScopedUnchecked<'a, 'b, T>
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