Struct mini_io_queue::RegionMut
source · [−]pub struct RegionMut<'a, T>(_, _);
Expand description
A region of two separate mutable slices that represent continuous data.
This is the mutable equivalent to Region
, allowing mutable access to the contained slices.
Implementations
sourceimpl<'a, T> RegionMut<'a, T>
impl<'a, T> RegionMut<'a, T>
sourcepub fn new(slice_0: &'a mut [T], slice_1: &'a mut [T]) -> Self
pub fn new(slice_0: &'a mut [T], slice_1: &'a mut [T]) -> Self
Creates a region with two mutable slices.
The slices should represent continuous data, where slice_0
goes before slice_1
.
sourcepub fn iter(&self) -> impl Iterator<Item = &T>
pub fn iter(&self) -> impl Iterator<Item = &T>
Returns an iterator over the region.
The iterator yields all items from start to end.
sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut T>
Returns an iterator that allows modifying each value.
The iterator yields all items from start to end.
sourcepub fn contiguous(&self) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn contiguous(&self) -> &[T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the first contiguous slice in the region.
The slice will not necessarily contain all data in the region.
sourcepub fn contiguous_mut(&mut self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn contiguous_mut(&mut self) -> &mut [T]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns a mutable reference to the first contiguous slice in the region.
The slice will not necessarily contain all data in the region.
sourceimpl<'a, T> RegionMut<'a, T> where
T: Copy,
impl<'a, T> RegionMut<'a, T> where
T: Copy,
sourcepub fn copy_to_slice(&self, slice: &mut [T])
pub fn copy_to_slice(&self, slice: &mut [T])
Copies all elements in the region into dest
, using a memcpy.
The length of dest
must be the same as self
.
If T
does not implement Copy
, use clone_to_slice
.
Panics
This function will panic if dest
has a different length to self
.
sourcepub fn copy_from_slice(&mut self, src: &[T])
pub fn copy_from_slice(&mut self, src: &[T])
Copies all elements from src
into the region, using a memcpy.
The length of src
must be the same as self
.
If T
does not implement Copy
, use clone_from_slice
.
Panics
This function will panic if src
has a different length to self
.
sourceimpl<'a, T> RegionMut<'a, T> where
T: Clone,
impl<'a, T> RegionMut<'a, T> where
T: Clone,
sourcepub fn clone_to_slice(&self, slice: &mut [T])
pub fn clone_to_slice(&self, slice: &mut [T])
Copies all elements in the region into dest
.
The length of dest
must be the same as self
.
Panics
This function will panic if dest
has a different length to self
.
sourcepub fn clone_from_slice(&mut self, src: &[T])
pub fn clone_from_slice(&mut self, src: &[T])
Copies all elements from src
into the region.
The length of src
must be the same as self
.
Panics
This function will panic if src
has a different length to self
.
Trait Implementations
sourceimpl<'a, T: PartialEq> PartialEq<RegionMut<'a, T>> for RegionMut<'a, T>
impl<'a, T: PartialEq> PartialEq<RegionMut<'a, T>> for RegionMut<'a, T>
impl<'a, T: Eq> Eq for RegionMut<'a, T>
impl<'a, T> StructuralEq for RegionMut<'a, T>
impl<'a, T> StructuralPartialEq for RegionMut<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for RegionMut<'a, T> where
T: RefUnwindSafe,
impl<'a, T> Send for RegionMut<'a, T> where
T: Send,
impl<'a, T> Sync for RegionMut<'a, T> where
T: Sync,
impl<'a, T> Unpin for RegionMut<'a, T>
impl<'a, T> !UnwindSafe for RegionMut<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more