pub struct SliceUnchecked<'a, T> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, T> SliceUnchecked<'a, T>
impl<'a, T> SliceUnchecked<'a, T>
Sourcepub const unsafe fn new(buf: &'a [T]) -> Self
pub const unsafe fn new(buf: &'a [T]) -> Self
Create a new SliceUnchecked from the given slice.
§Safety
SliceUnchecked’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 SliceUnchecked<'a, u8>
impl<'a> Reader<'a> for SliceUnchecked<'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_borrowed(&mut self, len: usize) -> ReadResult<&'a [u8]>
fn take_borrowed(&mut self, len: usize) -> ReadResult<&'a [u8]>
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(&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, T> Freeze for SliceUnchecked<'a, T>
impl<'a, T> RefUnwindSafe for SliceUnchecked<'a, T>where
&'a [T]: RefUnwindSafe,
impl<'a, T> Send for SliceUnchecked<'a, T>
impl<'a, T> Sync for SliceUnchecked<'a, T>
impl<'a, T> Unpin for SliceUnchecked<'a, T>
impl<'a, T> UnsafeUnpin for SliceUnchecked<'a, T>where
&'a [T]: UnsafeUnpin,
impl<'a, T> UnwindSafe for SliceUnchecked<'a, T>where
&'a [T]: 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