Struct diem_sdk::crypto::validatable::Validatable
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§
§impl<V> Validatable<V>where
V: Validate,
impl<V> Validatable<V>where V: Validate,
pub fn new_valid(valid: V) -> Validatable<V>
pub fn new_valid(valid: V) -> Validatable<V>
Create a new Validatable
from a valid type
pub 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
pub 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§
§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,
§fn clone(&self) -> Validatable<V>
fn clone(&self) -> Validatable<V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§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>,
§fn 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
§impl<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,
§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>,
§fn eq(&self, other: &Validatable<V>) -> bool
fn eq(&self, other: &Validatable<V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§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,
§fn 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§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.