[][src]Enum paperclip::v2::models::Either

pub enum Either<L, R> {
    Left(L),
    Right(R),
}

Either from "either" crate. We can't use that crate because we don't want the enum to be tagged during de/serialization.

Variants

Left(L)
Right(R)

Methods

impl<L, R> Either<L, R>[src]

pub fn right(&self) -> Option<&R>[src]

Get a readable reference to the right variant (if it exists).

pub fn right_mut(&mut self) -> Option<&mut R>[src]

Get a mutable reference to the right variant (if it exists).

pub fn left(&self) -> Option<&L>[src]

Get a readable reference to the left variant (if it exists).

pub fn left_mut(&mut self) -> Option<&mut L>[src]

Get a mutable reference to the left variant (if it exists).

impl<T> Either<T, Vec<T>>[src]

pub fn left_or_one_in_right(&self) -> Option<&T>[src]

Convenience method for getting either the value in the left or one from right, given that the right variant can contain more than one values in a vector.

Trait Implementations

impl<L, R> Clone for Either<L, R> where
    L: Clone,
    R: Clone
[src]

impl<L, R> Debug for Either<L, R> where
    L: Debug,
    R: Debug
[src]

impl<T> Deref for Either<Reference, T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Either<Reference, T>[src]

impl<'de, L, R> Deserialize<'de> for Either<L, R> where
    L: Deserialize<'de>,
    R: Deserialize<'de>, 
[src]

impl<L, R> Serialize for Either<L, R> where
    L: Serialize,
    R: Serialize
[src]

Auto Trait Implementations

impl<L, R> RefUnwindSafe for Either<L, R> where
    L: RefUnwindSafe,
    R: RefUnwindSafe

impl<L, R> Send for Either<L, R> where
    L: Send,
    R: Send

impl<L, R> Sync for Either<L, R> where
    L: Sync,
    R: Sync

impl<L, R> Unpin for Either<L, R> where
    L: Unpin,
    R: Unpin

impl<L, R> UnwindSafe for Either<L, R> where
    L: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T, A, P> Access<T> for P where
    A: Access<T>,
    P: Deref<Target = A>, 
[src]

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more

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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T, A> DynAccess<T> for A where
    A: Access<T>,
    <A as Access<T>>::Guard: 'static, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,