Struct diem_sdk::crypto::validatable::Validatable [−][src]
pub struct Validatable<V> where
V: Validate, { /* fields omitted */ }
Expand description
Used in connection with the Validate
trait to be able to represent types which can benefit
from deferred validation as a performance optimization.
Implementations
Create a new Validatable
from a valid type
Create a new Validatable
from an unvalidated type
Return a reference to the unvalidated form V::Unvalidated
Try to validate the unvalidated form returning Some(&V)
on success and None
on failure.
Trait Implementations
impl<V> Clone for Validatable<V> where
V: Clone + Validate,
<V as Validate>::Unvalidated: Clone,
impl<V> Clone for Validatable<V> where
V: Clone + Validate,
<V as Validate>::Unvalidated: Clone,
impl<V> Debug for Validatable<V> where
V: Debug + Validate,
<V as Validate>::Unvalidated: Debug,
impl<V> Debug for Validatable<V> where
V: Debug + Validate,
<V as Validate>::Unvalidated: Debug,
impl<'de, V> Deserialize<'de> for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: Deserialize<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Validatable<V>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<Validatable<V>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<V> PartialEq<Validatable<V>> for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: PartialEq<<V as Validate>::Unvalidated>,
impl<V> PartialEq<Validatable<V>> for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: PartialEq<<V as Validate>::Unvalidated>,
impl<V> Serialize for Validatable<V> where
V: Validate + Serialize,
<V as Validate>::Unvalidated: Serialize,
impl<V> Serialize for Validatable<V> where
V: Validate + Serialize,
<V as Validate>::Unvalidated: Serialize,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<V> RefUnwindSafe for Validatable<V> where
V: UnwindSafe + RefUnwindSafe,
<V as Validate>::Unvalidated: RefUnwindSafe,
impl<V> Send for Validatable<V> where
V: Send,
<V as Validate>::Unvalidated: Send,
impl<V> Sync for Validatable<V> where
V: Send + Sync,
<V as Validate>::Unvalidated: Sync,
impl<V> Unpin for Validatable<V> where
V: Unpin,
<V as Validate>::Unvalidated: Unpin,
impl<V> UnwindSafe for Validatable<V> where
V: UnwindSafe,
<V as Validate>::Unvalidated: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more