Struct aptos_sdk::crypto::validatable::Validatable
source · [−]pub struct Validatable<V> where
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> Validatable<V> where
V: Validate,
impl<V> Validatable<V> where
V: Validate,
sourcepub fn new_valid(valid: V) -> Validatable<V>
pub fn new_valid(valid: V) -> Validatable<V>
Create a new Validatable from a valid type
sourcepub fn new_unvalidated(
unvalidated: <V as Validate>::Unvalidated
) -> Validatable<V>
pub fn new_unvalidated(
unvalidated: <V as Validate>::Unvalidated
) -> Validatable<V>
Create a new Validatable from an unvalidated type
sourcepub fn unvalidated(&self) -> &<V as Validate>::Unvalidated
pub fn unvalidated(&self) -> &<V as Validate>::Unvalidated
Return a reference to the unvalidated form V::Unvalidated
Trait Implementations
sourceimpl<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,
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 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,
sourceimpl<'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>,
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<Validatable<V>, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
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
sourceimpl<V> Hash for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: Hash,
impl<V> Hash for Validatable<V> where
V: Validate,
<V as Validate>::Unvalidated: Hash,
Simply calls the Hash implementation of V::Unvalidated
sourceimpl<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>,
Simply calls the equality operator of V::Unvalidated
sourceimpl<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,
Serializes a Validatable<V> using the serde::Serialize implementation of V::Unvalidated
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
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
impl<V> Eq for Validatable<V> where
V: Validate,
<V as Validate>::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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
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.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more