pub struct MicrodescriptorHash {
pub methods: Vec<u32>,
pub hashes: HashMap<String, String>,
}Expand description
Microdescriptor hash information from vote documents.
In directory authority votes, the m line contains microdescriptor
digests computed using different consensus methods. This allows
authorities to vote on which microdescriptor digest should be used
for each relay.
§Fields
methods- Consensus method numbers that produce this digesthashes- Mapping of hash algorithm names to digest values
§Format
The m line format in votes is:
m methods algorithm=digest [algorithm=digest ...]For example:
m 13,14,15 sha256=uaAYTOVuYRqUwJpNfP2WizjzO0FiNQB4U97xSQu+vMc§Example
use stem_rs::descriptor::router_status::MicrodescriptorHash;
use std::collections::HashMap;
let hash = MicrodescriptorHash {
methods: vec![13, 14, 15],
hashes: {
let mut h = HashMap::new();
h.insert("sha256".to_string(), "uaAYTOVuYRqUwJpNfP2WizjzO0FiNQB4U97xSQu+vMc".to_string());
h
},
};
assert_eq!(hash.methods, vec![13, 14, 15]);Fields§
§methods: Vec<u32>Consensus method numbers that produce this microdescriptor digest.
Different consensus methods may produce different microdescriptor
digests for the same relay. This field lists which methods
correspond to the digests in the hashes field.
hashes: HashMap<String, String>Mapping of hash algorithm names to digest values.
The key is the algorithm name (e.g., “sha256”) and the value is the base64-encoded digest.
Trait Implementations§
Source§impl Clone for MicrodescriptorHash
impl Clone for MicrodescriptorHash
Source§fn clone(&self) -> MicrodescriptorHash
fn clone(&self) -> MicrodescriptorHash
Returns a duplicate 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 moreSource§impl Debug for MicrodescriptorHash
impl Debug for MicrodescriptorHash
Source§impl PartialEq for MicrodescriptorHash
impl PartialEq for MicrodescriptorHash
impl StructuralPartialEq for MicrodescriptorHash
Auto Trait Implementations§
impl Freeze for MicrodescriptorHash
impl RefUnwindSafe for MicrodescriptorHash
impl Send for MicrodescriptorHash
impl Sync for MicrodescriptorHash
impl Unpin for MicrodescriptorHash
impl UnwindSafe for MicrodescriptorHash
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