Enum timely::communication::message::RefOrMut[][src]

pub enum RefOrMut<'a, T> where
    T: 'a, 
{ Ref(&'a T), Mut(&'a mut T), }

Either an immutable or mutable reference.

Variants

Ref(&'a T)

An immutable reference.

Mut(&'a mut T)

A mutable reference.

Implementations

impl<'a, T> RefOrMut<'a, T> where
    T: 'a + Clone
[src]

pub fn swap(self, element: &'b mut T)[src]

Extracts the contents of self, either by cloning or swapping.

This consumes self because its contents are now in an unknown state.

pub fn replace(self, element: T) -> T[src]

Extracts the contents of self, either by cloning or swapping.

This consumes self because its contents are now in an unknown state.

Trait Implementations

impl<'a, T> Deref for RefOrMut<'a, T> where
    T: 'a, 
[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for RefOrMut<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for RefOrMut<'a, T> where
    T: Send + Sync

impl<'a, T> Sync for RefOrMut<'a, T> where
    T: Sync

impl<'a, T> Unpin for RefOrMut<'a, T>

impl<'a, T> !UnwindSafe for RefOrMut<'a, T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.