#[non_exhaustive]pub enum Digest {
Sha256,
Sha384,
Sha512,
Sha1,
}Expand description
The algorithm a PeerId is made with: the <alg> of its <alg>:<hash> text.
Sha256 is the id of a peer by default. The others exist so a pin written
elsewhere can be read; whether a method accepts them is its own allow-list (a list of
Digest values). MD5 is not supported at all. Methods whose keys are named by another
algorithm add variants here, which is why the enum is non-exhaustive.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sha256
SHA-256, 32 bytes. The default and the only digest of an identity.
Sha384
SHA-384, 48 bytes.
Sha512
SHA-512, 64 bytes.
Sha1
SHA-1, 20 bytes. Legacy interoperability only.
Implementations§
Trait Implementations§
impl Copy for Digest
Source§impl<'de> Deserialize<'de> for Digest
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Digest
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Digest
Source§impl Leaf for Digest
impl Leaf for Digest
Source§fn labels() -> &'static [(&'static str, &'static str)]
fn labels() -> &'static [(&'static str, &'static str)]
A label for each fixed text the type names, as
(text, label): what a form shows
beside the text. Only the texts that have a label are listed.§fn same(a: &Self, b: &Self) -> bool
fn same(a: &Self, b: &Self) -> bool
Whether two values are the same setting. Settings are compared after both texts are
parsed into this type, never as the raw input: by default the canonical texts of the two
values are equal, which the round-trip contract makes the type’s own equality. A type
whose equal values can write different texts (
-0.0 and 0.0) overrides it.Source§impl Ord for Digest
impl Ord for Digest
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Digest
impl PartialOrd for Digest
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Describe for Twhere
T: Leaf,
impl<T> Describe for Twhere
T: Leaf,
§const LEAF: bool = true
const LEAF: bool = true
The type is one text: a [
Leaf], or an untagged enum whose arms all are. An untagged
enum counts the arms that are not, and holds at most one.§fn description() -> Description
fn description() -> Description
What this type is.