pub struct RefMut<T, B: ?Sized = T> { /* private fields */ }
Implementations§
Source§impl<T, B> RefMut<T, [B]>
impl<T, B> RefMut<T, [B]>
pub fn get_mut(this: Self, index: usize) -> Option<RefMut<T, B>>
pub fn range_mut(this: Self, range: Range<usize>) -> Option<RefMut<T, [B]>>
pub fn first_mut(this: Self) -> Option<RefMut<T, B>>
pub fn skip_first_mut(this: Self) -> Option<RefMut<T, [B]>>
pub fn split_first_mut(this: Self) -> Option<(RefMut<T, B>, RefMut<T, [B]>)>
pub fn split_at_mut(this: Self, mid: usize) -> (RefMut<T, [B]>, RefMut<T, [B]>)
pub fn split_at_mut_checked( this: Self, mid: usize, ) -> Result<(RefMut<T, [B]>, RefMut<T, [B]>), Self>
pub fn chunk_by_mut<F: for<'a> FnMut(&'a mut B, &'a mut B) -> bool>( this: Self, f: F, ) -> ChunkByMut<T, B, F> ⓘ
pub fn chunks_mut(this: Self, size: usize) -> ChunksMut<T, B> ⓘ
pub fn split_mut<F: for<'a> FnMut(&'a mut B) -> bool>( this: Self, f: F, ) -> SplitMut<T, B, F> ⓘ
pub fn split_inclusive_mut<F: for<'a> FnMut(&'a mut B) -> bool>( this: Self, f: F, ) -> SplitInclusiveMut<T, B, F> ⓘ
pub fn windows_mut(this: Self, size: usize) -> WindowsMut<T, B>
pub fn window_clusters_mut(this: Self, size: usize) -> WindowClustersMut<T, B>
Source§impl<T, B0, B1> RefMut<T, (B0, B1)>
impl<T, B0, B1> RefMut<T, (B0, B1)>
pub fn destructure(self) -> (RefMut<T, B0>, RefMut<T, B1>)
Source§impl<T, B0, B1, B2> RefMut<T, (B0, B1, B2)>
impl<T, B0, B1, B2> RefMut<T, (B0, B1, B2)>
pub fn destructure(self) -> (RefMut<T, B0>, RefMut<T, B1>, RefMut<T, B2>)
Source§impl<T, B0, B1, B2, B3> RefMut<T, (B0, B1, B2, B3)>
impl<T, B0, B1, B2, B3> RefMut<T, (B0, B1, B2, B3)>
Source§impl<T, B: ?Sized> RefMut<T, B>
impl<T, B: ?Sized> RefMut<T, B>
pub fn into_ref(self) -> Ref<T, B>
Sourcepub fn into_ref_forward(self) -> RefForward<T, B> ⓘ
pub fn into_ref_forward(self) -> RefForward<T, B> ⓘ
Converts self into a new ready RefForward
future.
Sourcepub fn into_mut_forward(self) -> RefMutForward<T, B> ⓘ
pub fn into_mut_forward(self) -> RefMutForward<T, B> ⓘ
Converts self into a new ready RefMutForward
future.
pub fn forward_ref(self) -> (RefForward<T, B>, Ref<T, B>)
pub fn forward_mut(self) -> (RefMutForward<T, B>, RefMut<T, B>)
pub fn cleave_ref<U>(self, f: impl FnOnce(Ref<T, B>) -> U) -> RefForward<T, B> ⓘ
pub fn cleave_mut<U>( self, f: impl FnOnce(RefMut<T, B>) -> U, ) -> RefMutForward<T, B> ⓘ
Sourcepub fn map<C: ?Sized>(
self,
f: impl for<'a> FnOnce(&'a mut B) -> &'a mut C,
) -> RefMut<T, C>
pub fn map<C: ?Sized>( self, f: impl for<'a> FnOnce(&'a mut B) -> &'a mut C, ) -> RefMut<T, C>
Given that f
works for all lifetimes 'a
, it will also work for
the indeterminable, yet existant, lifetime of the BorrowInner
.
§Experimental
This is intended to be a safe API, and I believe that it is safe, however the work to prove this thoroughly is complex and has not yet been undertaken. This work will be done before v1.0.0.
Do not rely on this being safe in safety critical contexts
Sourcepub fn context<R>(
self,
f: impl for<'a> FnOnce(&'a mut B, Context<'a, T>) -> R,
) -> R
pub fn context<R>( self, f: impl for<'a> FnOnce(&'a mut B, Context<'a, T>) -> R, ) -> R
Uses the same principle behind other scoping APIs to provide additional support to specific lifetimes.
The lifetime in question here is the same 'a
as referenced in RefMut::map
, as the true 'a
can not be know
the lifetime '_
will be used as a stand_in as it is truly anonymous.
§Experimental
This is intended to be a safe API, and I believe that it is safe, however the work to prove this thoroughly is complex and has not yet been undertaken. This work will be done before v1.0.0.
Do not rely on this being safe in safety critical contexts
Sourcepub async fn scope<F: Future>(
self,
f: impl for<'a> FnOnce(&'a mut B, Context<'a, T>, Spawner<'a>) -> F,
) -> F::Output
pub async fn scope<F: Future>( self, f: impl for<'a> FnOnce(&'a mut B, Context<'a, T>, Spawner<'a>) -> F, ) -> F::Output
Uses the same principle behind other scoping APIs to provide additional support to specific lifetimes.
The lifetime in question here is the same 'a
as referenced in RefMut::map
, as the true 'a
can not be know
the lifetime '_
will be used as a stand_in as it is truly anonymous.
§Experimental
This is intended to be a safe API, and I believe that it is safe, however the work to prove this thoroughly is complex and has not yet been undertaken. This work will be done before v1.0.0.
Do not rely on this being safe in safety critical contexts
Sourcepub fn into_deref_mut(self) -> RefMut<T, B::Target>where
B: DerefMut,
pub fn into_deref_mut(self) -> RefMut<T, B::Target>where
B: DerefMut,
A special case of RefMut::map
to handle dereferencing.
§Experimental
This is intended to be a safe API, and I believe that it is safe, however the work to prove this thoroughly is complex and has not yet been undertaken. This work will be done before v1.0.0.
Do not rely on this being safe in safety critical contexts
Sourcepub fn into_borrow_mut<C>(self) -> RefMut<T, C>where
B: BorrowMut<C>,
pub fn into_borrow_mut<C>(self) -> RefMut<T, C>where
B: BorrowMut<C>,
A special case of RefMut::map
to handle borrowing.
§Experimental
This is intended to be a safe API, and I believe that it is safe, however the work to prove this thoroughly is complex and has not yet been undertaken. This work will be done before v1.0.0.
Do not rely on this being safe in safety critical contexts