Validated

Struct Validated 

Source
pub struct Validated<E, T> { /* private fields */ }
Expand description

Simple wrapper type for data to track validity

Implementations§

Source§

impl<E, T> Validated<E, T>

Source

pub fn new(inner: T) -> Self

Source

pub fn into(self) -> T

Trait Implementations§

Source§

impl<E, T> AsMut<T> for Validated<E, T>

Source§

fn as_mut(&mut self) -> &mut T

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<E, T> AsRef<T> for Validated<E, T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<E, T> Borrow<T> for Validated<E, T>

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<E, T> BorrowMut<T> for Validated<E, T>

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<E, T> Caption<E> for Validated<E, T>
where T: Caption<E>,

Source§

fn caption(&self) -> Cow<'_, str>

Source§

fn len(&self) -> usize

Source§

impl<E, T> CaptionMut<E> for Validated<E, T>
where T: CaptionMut<E>,

Source§

fn push(&mut self, off: usize, s: &str)

Source§

fn pop_left(&mut self, off: usize, n: usize)

Source§

fn replace(&mut self, s: &str)

Source§

impl<E, T> Deref for Validated<E, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<E, T> DerefMut for Validated<E, T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<E, T> From<T> for Validated<E, T>

Source§

fn from(v: T) -> Self

Converts to this type from the input type.
Source§

impl<E, T> Validation<E> for Validated<E, T>

Source§

fn valid(&self, _: &dyn Any) -> bool

Source§

impl<E, T> ValidationMut<E> for Validated<E, T>

Source§

fn validate(&mut self) -> Arc<dyn Any>

Called if e.g. dependent data is just generated, marks this data as valid, and returns side data to cache along with the dependent generated data. Impl note: this could be called more than once on the same data

Auto Trait Implementations§

§

impl<E, T> Freeze for Validated<E, T>
where T: Freeze,

§

impl<E, T> RefUnwindSafe for Validated<E, T>

§

impl<E, T> Send for Validated<E, T>
where T: Send, E: Send,

§

impl<E, T> Sync for Validated<E, T>
where T: Sync, E: Sync,

§

impl<E, T> Unpin for Validated<E, T>
where T: Unpin, E: Unpin,

§

impl<E, T> UnwindSafe for Validated<E, T>
where T: UnwindSafe, E: UnwindSafe,

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, I> AsRefMut<I> for T
where T: AsRef<I> + AsMut<I>,

Source§

fn as_ref(&self) -> &I

Source§

fn as_mut(&mut self) -> &mut I

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

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> FromInto<U> for T
where T: From<U> + Into<U>,

Source§

fn qfrom(t: U) -> T

Source§

fn qinto(self) -> U

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<'a, S, T, E> StyleSelectorAppend<&'a [S], E> for T
where T: StyleSelectorAppend<S, E>, S: StyleSelectag<E>,

Source§

fn append(&mut self, selectag: &[S])

Source§

fn with(&self, selectag: S) -> Self
where Self: Sized,

Source§

fn from(selectag: S) -> Self
where Self: Sized,

Source§

impl<S, T, E> StyleSelectorAppend<&S, E> for T
where T: StyleSelectorAppend<S, E>, S: StyleSelectag<E>,

Source§

fn append(&mut self, selectag: &S)

Source§

fn with(&self, selectag: S) -> Self
where Self: Sized,

Source§

fn from(selectag: S) -> Self
where Self: Sized,

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.