pub struct RouterStatusBuilder { /* private fields */ }
Expand description
A Builder object for creating a RouterStatus and adding it to a consensus.
Implementations§
Source§impl RouterStatusBuilder
impl RouterStatusBuilder
Sourcepub fn nickname(&mut self, nickname: String) -> &mut Self
Available on crate feature build_docs
only.
pub fn nickname(&mut self, nickname: String) -> &mut Self
build_docs
only.Set the nickname for this routerstatus.
This value defaults to “Unnamed”.
Sourcepub fn identity(&mut self, identity: RsaIdentity) -> &mut Self
Available on crate feature build_docs
only.
pub fn identity(&mut self, identity: RsaIdentity) -> &mut Self
build_docs
only.Set the RSA identity for this routerstatus.
(The Ed25519 identity is in the microdescriptor).
This value is required.
Sourcepub fn add_or_port(&mut self, addr: SocketAddr) -> &mut Self
Available on crate feature build_docs
only.
pub fn add_or_port(&mut self, addr: SocketAddr) -> &mut Self
build_docs
only.Add an OrPort at addr
to this routerstatus.
At least one value here is required.
Sourcepub fn doc_digest(&mut self, doc_digest: DocDigest) -> &mut Self
Available on crate feature build_docs
only.
pub fn doc_digest(&mut self, doc_digest: DocDigest) -> &mut Self
build_docs
only.Set the document digest for this routerstatus.
This value is required.
Sourcepub fn set_flags(&mut self, flags: RelayFlags) -> &mut Self
Available on crate feature build_docs
only.
pub fn set_flags(&mut self, flags: RelayFlags) -> &mut Self
build_docs
only.Replace the current flags in this routerstatus with flags
.
Sourcepub fn add_flags(&mut self, flags: RelayFlags) -> &mut Self
Available on crate feature build_docs
only.
pub fn add_flags(&mut self, flags: RelayFlags) -> &mut Self
build_docs
only.Make all the flags in flags
become set on this routerstatus,
in addition to the flags already set.
Sourcepub fn clear_flags(&mut self, flags: RelayFlags) -> &mut Self
Available on crate features build_docs
and testing
only.
pub fn clear_flags(&mut self, flags: RelayFlags) -> &mut Self
build_docs
and testing
only.Make all the flags in flags
become cleared on this routerstatus.
Sourcepub fn version(&mut self, version: String) -> &mut Self
Available on crate feature build_docs
only.
pub fn version(&mut self, version: String) -> &mut Self
build_docs
only.Set the version of the relay described in this routerstatus.
This value is optional.
Sourcepub fn protos(&mut self, protos: Protocols) -> &mut Self
Available on crate feature build_docs
only.
pub fn protos(&mut self, protos: Protocols) -> &mut Self
build_docs
only.Set the list of subprotocols supported by the relay described by this routerstatus.
This value is required.
Sourcepub fn weight(&mut self, weight: RelayWeight) -> &mut Self
Available on crate feature build_docs
only.
pub fn weight(&mut self, weight: RelayWeight) -> &mut Self
build_docs
only.Set the weight of this routerstatus for random selection.
This value is optional; it defaults to 0.
Sourcepub fn build_into(&self, builder: &mut ConsensusBuilder) -> Result<()>
Available on crate feature build_docs
only.
pub fn build_into(&self, builder: &mut ConsensusBuilder) -> Result<()>
build_docs
only.Try to finish this builder and add its RouterStatus to a provided ConsensusBuilder.x
Sourcepub fn build(&self) -> Result<RouterStatus>
Available on crate feature build_docs
only.
pub fn build(&self) -> Result<RouterStatus>
build_docs
only.Return a router status built by this object.
Trait Implementations§
Source§impl Clone for RouterStatusBuilder
Available on crate feature build_docs
only.
impl Clone for RouterStatusBuilder
build_docs
only.Source§fn clone(&self) -> RouterStatusBuilder
fn clone(&self) -> RouterStatusBuilder
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 RouterStatusBuilder
impl RefUnwindSafe for RouterStatusBuilder
impl Send for RouterStatusBuilder
impl Sync for RouterStatusBuilder
impl Unpin for RouterStatusBuilder
impl UnwindSafe for RouterStatusBuilder
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