#[non_exhaustive]pub struct Microdesc {
pub sha256: MdDigest,
pub ntor_onion_key: PublicKey,
pub family: Arc<RelayFamily>,
pub ipv4_policy: Arc<PortPolicy>,
pub ipv6_policy: Arc<PortPolicy>,
pub ed25519_id: Ed25519Identity,
pub family_ids: Vec<RelayFamilyId>,
}Expand description
A single microdescriptor.
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.sha256: MdDigestdangerous-expose-struct-fields only.The 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.
ntor_onion_key: PublicKeydangerous-expose-struct-fields only.Public key used for the ntor circuit extension protocol.
family: Arc<RelayFamily>dangerous-expose-struct-fields only.Declared family for this relay.
ipv4_policy: Arc<PortPolicy>dangerous-expose-struct-fields only.List of IPv4 ports to which this relay will exit
ipv6_policy: Arc<PortPolicy>dangerous-expose-struct-fields only.List of IPv6 ports to which this relay will exit
ed25519_id: Ed25519Identitydangerous-expose-struct-fields only.Ed25519 identity for this relay
family_ids: Vec<RelayFamilyId>dangerous-expose-struct-fields only.Family identities for this relay.
Implementations§
Source§impl Microdesc
impl Microdesc
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.
Sourcepub fn ipv4_policy(&self) -> &Arc<PortPolicy>
pub fn ipv4_policy(&self) -> &Arc<PortPolicy>
Return the ipv4 exit policy for this microdesc
Sourcepub fn ipv6_policy(&self) -> &Arc<PortPolicy>
pub fn ipv6_policy(&self) -> &Arc<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§
Auto Trait Implementations§
impl Freeze for Microdesc
impl RefUnwindSafe for Microdesc
impl Send for Microdesc
impl Sync for Microdesc
impl Unpin for Microdesc
impl UnwindSafe for Microdesc
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
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<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