Enum near_primitives::utils::MaybeValidated[][src]

pub enum MaybeValidated<T> {
    Validated(T),
    NotValidated(T),
}

A data structure for tagging data as already being validated to prevent redundant work.

Variants

Validated(T)
NotValidated(T)

Implementations

impl<T> MaybeValidated<T>[src]

pub fn validate_with<E, F: FnOnce(&T) -> Result<bool, E>>(
    &self,
    f: F
) -> Result<bool, E>
[src]

pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> MaybeValidated<U>[src]

pub fn as_ref(&self) -> MaybeValidated<&T>[src]

pub fn extract(self) -> T[src]

Trait Implementations

impl<T: Sized> Deref for MaybeValidated<T>[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> RefUnwindSafe for MaybeValidated<T> where
    T: RefUnwindSafe

impl<T> Send for MaybeValidated<T> where
    T: Send

impl<T> Sync for MaybeValidated<T> where
    T: Sync

impl<T> Unpin for MaybeValidated<T> where
    T: Unpin

impl<T> UnwindSafe for MaybeValidated<T> where
    T: UnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,