Struct tor_netdoc::doc::microdesc::MicrodescBuilder
source · pub struct MicrodescBuilder { /* private fields */ }
build_docs
only.Expand description
A builder object used to construct a microdescriptor.
Create one of these with the Microdesc::builder
method.
This facility is only enabled when the crate is built with
the build_docs
feature.
Implementations§
source§impl MicrodescBuilder
impl MicrodescBuilder
sourcepub fn ntor_key(&mut self, key: PublicKey) -> &mut Self
pub fn ntor_key(&mut self, key: PublicKey) -> &mut Self
Set the ntor onion key.
This key is required for a well-formed microdescriptor.
sourcepub fn ed25519_id(&mut self, key: Ed25519Identity) -> &mut Self
pub fn ed25519_id(&mut self, key: Ed25519Identity) -> &mut Self
Set the ed25519 identity key.
This key is required for a well-formed microdescriptor.
sourcepub fn family(&mut self, family: RelayFamily) -> &mut Self
pub fn family(&mut self, family: RelayFamily) -> &mut Self
Set the family of this relay.
By default, this family is empty.
sourcepub fn ipv4_policy(&mut self, policy: PortPolicy) -> &mut Self
pub fn ipv4_policy(&mut self, policy: PortPolicy) -> &mut Self
Set the ipv4 exit policy of this relay.
By default, this policy is reject 1-65535
.
sourcepub fn ipv6_policy(&mut self, policy: PortPolicy) -> &mut Self
pub fn ipv6_policy(&mut self, policy: PortPolicy) -> &mut Self
Set the ipv6 exit policy of this relay.
By default, this policy is reject 1-65535
.
sourcepub fn parse_family(&mut self, family: &str) -> Result<&mut Self>
pub fn parse_family(&mut self, family: &str) -> Result<&mut Self>
Set the family of this relay based on parsing a string.
sourcepub fn parse_ipv4_policy(&mut self, policy: &str) -> Result<&mut Self>
pub fn parse_ipv4_policy(&mut self, policy: &str) -> Result<&mut Self>
Set the ipv4 exit policy of this relay based on parsing a string.
By default, this policy is reject 1-65535
.
sourcepub fn parse_ipv6_policy(&mut self, policy: &str) -> Result<&mut Self>
pub fn parse_ipv6_policy(&mut self, policy: &str) -> Result<&mut Self>
Set the ipv6 exit policy of this relay based on parsing a string.
By default, this policy is reject 1-65535
.
sourcepub fn testing_md(&self) -> Result<Microdesc>
pub fn testing_md(&self) -> Result<Microdesc>
Try to build a microdescriptor from the settings on this builder.
Give an error if any required fields are not set.
§Limitations
This is only for testing, since it does actually encode the information in a string, and since it sets the sha256 digest field at random.
In the future, when we have authority support, we’ll need an encoder function instead.
Trait Implementations§
source§impl Clone for MicrodescBuilder
impl Clone for MicrodescBuilder
source§fn clone(&self) -> MicrodescBuilder
fn clone(&self) -> MicrodescBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MicrodescBuilder
impl RefUnwindSafe for MicrodescBuilder
impl Send for MicrodescBuilder
impl Sync for MicrodescBuilder
impl Unpin for MicrodescBuilder
impl UnwindSafe for MicrodescBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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