#[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,
}
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: MdDigest
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: PublicKey
Public key used for the ntor circuit extension protocol.
family: Arc<RelayFamily>
Declared family for this relay.
ipv4_policy: Arc<PortPolicy>
List of IPv4 ports to which this relay will exit
ipv6_policy: Arc<PortPolicy>
List of IPv6 ports to which this relay will exit
ed25519_id: Ed25519Identity
Ed25519 identity for this relay
Implementations
sourceimpl Microdesc
impl Microdesc
sourcepub fn builder() -> MicrodescBuilder
pub fn builder() -> MicrodescBuilder
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Microdesc
impl Send for Microdesc
impl Sync for Microdesc
impl Unpin for Microdesc
impl UnwindSafe for Microdesc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more