ViewMut

Struct ViewMut 

Source
pub struct ViewMut<'a, K: ?Sized + ToIndex, P, S: GetMut<K>>
where S::Output: Project<P>,
{ data: &'a mut S, _k: PhantomData<K>, _proj: PhantomData<P>, }

Fields§

§data: &'a mut S§_k: PhantomData<K>§_proj: PhantomData<P>

Implementations§

Source§

impl<'a, K: ?Sized + ToIndex, P, S: GetMut<K>> ViewMut<'a, K, P, S>
where S::Output: Project<P>,

Source

pub fn new(data: &'a mut S) -> Self

Source

pub fn with<F: FnOnce(&mut Self) -> R, R>(data: &'a mut S, f: F) -> R

Trait Implementations§

Source§

impl<'a, K: ?Sized + ToIndex, P, S: GetMut<K>> Get<K> for ViewMut<'a, K, P, S>
where S::Output: Project<P>,

Source§

type Output = P

Source§

fn get<Q: Borrow<K>>(&self, idx: Q) -> Option<&P>

Source§

impl<'a, K: ?Sized + ToIndex, P, S: GetMut<K>> GetMut<K> for ViewMut<'a, K, P, S>
where S::Output: Project<P>,

Source§

fn get_mut<Q: Borrow<K>>(&mut self, idx: Q) -> Option<&mut P>

Source§

fn get2_mut<Q: Borrow<K>>( &mut self, idx1: Q, idx2: Q, ) -> (Option<&mut P>, Option<&mut P>)

Source§

fn get3_mut<Q: Borrow<K>>( &mut self, idx1: Q, idx2: Q, idx3: Q, ) -> (Option<&mut P>, Option<&mut P>, Option<&mut P>)

Auto Trait Implementations§

§

impl<'a, K, P, S> Freeze for ViewMut<'a, K, P, S>
where K: ?Sized,

§

impl<'a, K, P, S> RefUnwindSafe for ViewMut<'a, K, P, S>

§

impl<'a, K, P, S> Send for ViewMut<'a, K, P, S>
where S: Send, K: Send + ?Sized, P: Send,

§

impl<'a, K, P, S> Sync for ViewMut<'a, K, P, S>
where S: Sync, K: Sync + ?Sized, P: Sync,

§

impl<'a, K, P, S> Unpin for ViewMut<'a, K, P, S>
where K: Unpin + ?Sized, P: Unpin,

§

impl<'a, K, P, S> !UnwindSafe for ViewMut<'a, K, P, S>

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<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.
Source§

impl<T> ThreadArgument for T
where T: Send + 'static,