Struct aptos_crypto::validatable::Validatable
source · [−]pub struct Validatable<V: Validate> { /* private fields */ }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
sourceimpl<V: Validate> Validatable<V>
impl<V: Validate> Validatable<V>
sourcepub fn new_unvalidated(unvalidated: V::Unvalidated) -> Self
pub fn new_unvalidated(unvalidated: V::Unvalidated) -> Self
Create a new Validatable from an unvalidated type
sourcepub fn unvalidated(&self) -> &V::Unvalidated
pub fn unvalidated(&self) -> &V::Unvalidated
Return a reference to the unvalidated form V::Unvalidated
Trait Implementations
sourceimpl<V: Clone + Validate> Clone for Validatable<V> where
V::Unvalidated: Clone,
impl<V: Clone + Validate> Clone for Validatable<V> where
V::Unvalidated: Clone,
sourcefn clone(&self) -> Validatable<V>
fn clone(&self) -> Validatable<V>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<V: Debug + Validate> Debug for Validatable<V> where
V::Unvalidated: Debug,
impl<V: Debug + Validate> Debug for Validatable<V> where
V::Unvalidated: Debug,
sourceimpl<'de, V> Deserialize<'de> for Validatable<V> where
V: Validate,
V::Unvalidated: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for Validatable<V> where
V: Validate,
V::Unvalidated: Deserialize<'de>,
Deserializes a Validatable<V> using the serde::Deserialize implementation of V::Unvalidated.
Does not perform validation on the deserialized V::Unvalidated object.
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<V> Hash for Validatable<V> where
V: Validate,
V::Unvalidated: Hash,
impl<V> Hash for Validatable<V> where
V: Validate,
V::Unvalidated: Hash,
Simply calls the Hash implementation of V::Unvalidated
sourceimpl<V> PartialEq<Validatable<V>> for Validatable<V> where
V: Validate,
V::Unvalidated: PartialEq,
impl<V> PartialEq<Validatable<V>> for Validatable<V> where
V: Validate,
V::Unvalidated: PartialEq,
Simply calls the equality operator of V::Unvalidated
sourceimpl<V> Serialize for Validatable<V> where
V: Validate + Serialize,
V::Unvalidated: Serialize,
impl<V> Serialize for Validatable<V> where
V: Validate + Serialize,
V::Unvalidated: Serialize,
Serializes a Validatable<V> using the serde::Serialize implementation of V::Unvalidated
impl<V> Eq for Validatable<V> where
V: Validate,
V::Unvalidated: Eq,
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
impl<T> TestOnlyHash for T where
T: Serialize + ?Sized,
sourcefn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.