Struct RefMut

Source
pub struct RefMut<T, B: ?Sized = T> { /* private fields */ }

Implementations§

Source§

impl<T, B> RefMut<T, [B]>

Source

pub fn get_mut(this: Self, index: usize) -> Option<RefMut<T, B>>

Source

pub fn range_mut(this: Self, range: Range<usize>) -> Option<RefMut<T, [B]>>

Source

pub fn first_mut(this: Self) -> Option<RefMut<T, B>>

Source

pub fn skip_first_mut(this: Self) -> Option<RefMut<T, [B]>>

Source

pub fn split_first_mut(this: Self) -> Option<(RefMut<T, B>, RefMut<T, [B]>)>

Source

pub fn split_at_mut(this: Self, mid: usize) -> (RefMut<T, [B]>, RefMut<T, [B]>)

Source

pub fn split_at_mut_checked( this: Self, mid: usize, ) -> Result<(RefMut<T, [B]>, RefMut<T, [B]>), Self>

Source

pub fn chunk_by_mut<F: for<'a> FnMut(&'a mut B, &'a mut B) -> bool>( this: Self, f: F, ) -> ChunkByMut<T, B, F>

Source

pub fn chunks_mut(this: Self, size: usize) -> ChunksMut<T, B>

Source

pub fn split_mut<F: for<'a> FnMut(&'a mut B) -> bool>( this: Self, f: F, ) -> SplitMut<T, B, F>

Source

pub fn split_inclusive_mut<F: for<'a> FnMut(&'a mut B) -> bool>( this: Self, f: F, ) -> SplitInclusiveMut<T, B, F>

Source

pub fn windows_mut(this: Self, size: usize) -> WindowsMut<T, B>

Source

pub fn window_clusters_mut(this: Self, size: usize) -> WindowClustersMut<T, B>

Source§

impl<T> RefMut<T, ()>

Source

pub fn destructure(self)

Source§

impl<T, B0> RefMut<T, (B0,)>

Source

pub fn destructure(self) -> (RefMut<T, B0>,)

Source§

impl<T, B0, B1> RefMut<T, (B0, B1)>

Source

pub fn destructure(self) -> (RefMut<T, B0>, RefMut<T, B1>)

Source§

impl<T, B0, B1, B2> RefMut<T, (B0, B1, B2)>

Source

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)>

Source

pub fn destructure( self, ) -> (RefMut<T, B0>, RefMut<T, B1>, RefMut<T, B2>, RefMut<T, B3>)

Source§

impl<T, B: ?Sized> RefMut<T, B>

Source

pub fn into_ref(self) -> Ref<T, B>

Source

pub fn into_ref_forward(self) -> RefForward<T, B>

Converts self into a new ready RefForward future.

Source

pub fn into_mut_forward(self) -> RefMutForward<T, B>

Converts self into a new ready RefMutForward future.

Source

pub fn forward_ref(self) -> (RefForward<T, B>, Ref<T, B>)

Source

pub fn forward_mut(self) -> (RefMutForward<T, B>, RefMut<T, B>)

Source

pub fn cleave_ref<U>(self, f: impl FnOnce(Ref<T, B>) -> U) -> RefForward<T, B>

Source

pub fn cleave_mut<U>( self, f: impl FnOnce(RefMut<T, B>) -> U, ) -> RefMutForward<T, B>

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl<T, B: ?Sized> Deref for RefMut<T, B>

Source§

type Target = B

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T, B: ?Sized> DerefMut for RefMut<T, B>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T, B: ?Sized> From<RefMut<T, B>> for Ref<T, B>

Source§

fn from(value: RefMut<T, B>) -> Self

Converts to this type from the input type.
Source§

impl<T, B> IntoIterator for RefMut<T, [B]>

Source§

type Item = RefMut<T, B>

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<T, B>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<T: Send, B: ?Sized + Send> Send for RefMut<T, B>

Source§

impl<T, B: ?Sized + Sync> Sync for RefMut<T, B>

Auto Trait Implementations§

§

impl<T, B> Freeze for RefMut<T, B>
where B: ?Sized,

§

impl<T, B = T> !RefUnwindSafe for RefMut<T, B>

§

impl<T, B> Unpin for RefMut<T, B>
where B: ?Sized,

§

impl<T, B = T> !UnwindSafe for RefMut<T, B>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.