#[non_exhaustive]pub struct MicrodescAndHash {
pub md: Microdesc,
pub sha256: MdDigest,
}Expand description
A single microdescriptor and also its SHA256 hash
API compatibility type.
This type is only generated when the microdescriptor is parsed
using the old parser (MicrodescAndHash::parse)
rather than the new one
(Microdesc as NetdocParseable).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.md: MicrodescThe microdescriptor
sha256: MdDigestThe SHA256 digest of the text of this microdescriptor.
This value is used to identify the microdescriptor when downloading it, and when listing it in a consensus document.
Implementations§
Source§impl MicrodescAndHash
impl MicrodescAndHash
Sourcepub fn builder() -> MicrodescBuilder
Available on crate feature build_docs only.
pub fn builder() -> MicrodescBuilder
build_docs only.Create a new MicrodescBuilder that can be used to construct microdescriptors.
This function is only available when the crate is built with the
build_docs feature.
§Limitations
The generated microdescriptors cannot yet be encoded, and do not yet have correct sha256 digests. As such they are only useful for testing.
Source§impl MicrodescAndHash
impl MicrodescAndHash
Sourcepub fn parse(s: &str) -> Result<MicrodescAndHash>
pub fn parse(s: &str) -> Result<MicrodescAndHash>
Parse a string into a new microdescriptor.
Methods from Deref<Target = Microdesc>§
Sourcepub fn ipv4_policy(&self) -> &Intern<PortPolicy>
pub fn ipv4_policy(&self) -> &Intern<PortPolicy>
Return the ipv4 exit policy for this microdesc
Sourcepub fn ipv6_policy(&self) -> &Intern<PortPolicy>
pub fn ipv6_policy(&self) -> &Intern<PortPolicy>
Return the ipv6 exit policy for this microdesc
Sourcepub fn family(&self) -> &RelayFamily
pub fn family(&self) -> &RelayFamily
Return the relay family for this microdesc
Sourcepub fn ed25519_id(&self) -> &Ed25519Identity
pub fn ed25519_id(&self) -> &Ed25519Identity
Return the ed25519 identity for this microdesc, if its Ed25519 identity is well-formed.
Sourcepub fn family_ids(&self) -> &[RelayFamilyId]
pub fn family_ids(&self) -> &[RelayFamilyId]
Return a list of family ids for this microdesc.
Trait Implementations§
Source§impl Clone for MicrodescAndHash
impl Clone for MicrodescAndHash
Source§fn clone(&self) -> MicrodescAndHash
fn clone(&self) -> MicrodescAndHash
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MicrodescAndHash
impl Debug for MicrodescAndHash
Source§impl Deref for MicrodescAndHash
impl Deref for MicrodescAndHash
Source§impl DerefMut for MicrodescAndHash
impl DerefMut for MicrodescAndHash
impl Eq for MicrodescAndHash
Source§impl PartialEq for MicrodescAndHash
impl PartialEq for MicrodescAndHash
Source§fn eq(&self, other: &MicrodescAndHash) -> bool
fn eq(&self, other: &MicrodescAndHash) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MicrodescAndHash
Auto Trait Implementations§
impl Freeze for MicrodescAndHash
impl RefUnwindSafe for MicrodescAndHash
impl Send for MicrodescAndHash
impl Sync for MicrodescAndHash
impl Unpin for MicrodescAndHash
impl UnsafeUnpin for MicrodescAndHash
impl UnwindSafe for MicrodescAndHash
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more