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

pub enum RefOrMut<'a, T> where
    T: 'a + '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.

Methods

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> Send for RefOrMut<'a, T> where
    T: Send + Sync

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

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.