Trait SerdeHash
pub trait SerdeHash:
Sized
+ FromStr
+ Display
+ Index<usize, Output = u8, Output = [u8]>
+ Index<RangeFull>{
const N: usize;
// Required method
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>;
// Provided methods
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer { ... }
fn deserialize<'de, D>(
d: D,
) -> Result<Self, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de> { ... }
}
Expand description
Default serialization/deserialization methods.
Required Associated Constants§
Required Methods§
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
Provided Methods§
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Do serde serialization.
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Do serde deserialization.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.