pub struct Microdesc {
pub onion_key: MicrodescIntroItem,
pub ntor_onion_key: Curve25519Public,
pub family: Intern<RelayFamily>,
pub family_ids: RelayFamilyIds,
pub ipv4_policy: Intern<PortPolicy>,
pub ipv6_policy: Intern<PortPolicy>,
pub ed25519_id: Ed25519IdentityLine,
/* private fields */
}Expand description
A single microdescriptor.
https://spec.torproject.org/dir-spec/computing-microdescriptors.html
Fields§
§onion_key: MicrodescIntroItemThe legacy onion key, whose object is optional but whose item serves as the intro line for these kind of descriptors.
ntor_onion_key: Curve25519PublicPublic key used for the ntor circuit extension protocol.
family: Intern<RelayFamily>Declared family for this relay.
family_ids: RelayFamilyIdsFamily identities for this relay.
ipv4_policy: Intern<PortPolicy>List of IPv4 ports to which this relay will exit
ipv6_policy: Intern<PortPolicy>List of IPv6 ports to which this relay will exit
ed25519_id: Ed25519IdentityLineEd25519 identity for this relay
Implementations§
Source§impl Microdesc
impl 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§
impl Eq for Microdesc
Source§impl From<MicrodescConstructor> for Microdesc
impl From<MicrodescConstructor> for Microdesc
Source§fn from(constructor: MicrodescConstructor) -> Microdesc
fn from(constructor: MicrodescConstructor) -> Microdesc
Converts to this type from the input type.
Source§impl NetdocEncodable for Microdesc
impl NetdocEncodable for Microdesc
Source§fn encode_unsigned(&self, out: &mut NetdocEncoder) -> Result<(), Bug>
fn encode_unsigned(&self, out: &mut NetdocEncoder) -> Result<(), Bug>
Append the document onto
outSource§impl NetdocParseable for Microdesc
impl NetdocParseable for Microdesc
Source§fn doctype_for_error() -> &'static str
fn doctype_for_error() -> &'static str
Document type for errors, normally its intro keyword
Source§fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
fn is_intro_item_keyword(kw: KeywordRef<'_>) -> bool
Is
Keyword an intro Item Keyword for this kind of document? Read moreSource§fn is_structural_keyword(kw: KeywordRef<'_>) -> Option<IsStructural>
fn is_structural_keyword(kw: KeywordRef<'_>) -> Option<IsStructural>
Is
Keyword a structural keyword for this kind of document? Read moreSource§fn from_items<'s>(
input: &mut ItemStream<'s>,
outer_stop: StopAt<impl StopPredicate>,
) -> Result<Self, ErrorProblem>
fn from_items<'s>( input: &mut ItemStream<'s>, outer_stop: StopAt<impl StopPredicate>, ) -> Result<Self, ErrorProblem>
Parse the document from a stream of Items Read more
impl StructuralPartialEq for Microdesc
Auto Trait Implementations§
impl Freeze for Microdesc
impl RefUnwindSafe for Microdesc
impl Send for Microdesc
impl Sync for Microdesc
impl Unpin for Microdesc
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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
Compare self to
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>
Converts
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>
Converts
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