Enum kernel::utilities::leasable_buffer::SubSliceMutImmut
source · pub enum SubSliceMutImmut<'a, T> {
Immutable(SubSlice<'a, T>),
Mutable(SubSliceMut<'a, T>),
}
Expand description
Holder for either a mutable or immutable SubSlice.
In cases where code needs to support either a mutable or immutable SubSlice,
SubSliceMutImmut
allows the code to store a single type which can
represent either option.
Variants§
Immutable(SubSlice<'a, T>)
Mutable(SubSliceMut<'a, T>)
Implementations§
source§impl<'a, T> SubSliceMutImmut<'a, T>
impl<'a, T> SubSliceMutImmut<'a, T>
pub fn reset(&mut self)
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the length of the currently accessible portion of the SubSlice.
pub fn slice<R: RangeBounds<usize>>(&mut self, range: R)
pub fn as_ptr(&self) -> *const T
pub fn map_mut(&mut self, f: impl Fn(&mut SubSliceMut<'a, T>))
Trait Implementations§
source§impl<'a, T> From<&'a [T]> for SubSliceMutImmut<'a, T>
impl<'a, T> From<&'a [T]> for SubSliceMutImmut<'a, T>
source§impl<'a, T> From<&'a mut [T]> for SubSliceMutImmut<'a, T>
impl<'a, T> From<&'a mut [T]> for SubSliceMutImmut<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for SubSliceMutImmut<'a, T>
impl<'a, T> RefUnwindSafe for SubSliceMutImmut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for SubSliceMutImmut<'a, T>
impl<'a, T> Sync for SubSliceMutImmut<'a, T>where
T: Sync,
impl<'a, T> Unpin for SubSliceMutImmut<'a, T>
impl<'a, T> !UnwindSafe for SubSliceMutImmut<'a, 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