pub struct RouterStatusBuilder { /* private fields */ }
plain-consensus
and build_docs
only.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
pub fn nickname(&mut self, nickname: String) -> &mut Self
Set the nickname for this routerstatus.
This value defaults to “Unnamed”.
Sourcepub fn identity(&mut self, identity: RsaIdentity) -> &mut Self
pub fn identity(&mut self, identity: RsaIdentity) -> &mut Self
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
pub fn add_or_port(&mut self, addr: SocketAddr) -> &mut Self
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
pub fn doc_digest(&mut self, doc_digest: DocDigest) -> &mut Self
Set the document digest for this routerstatus.
This value is required.
Sourcepub fn set_flags(&mut self, flags: RelayFlags) -> &mut Self
pub fn set_flags(&mut self, flags: RelayFlags) -> &mut Self
Replace the current flags in this routerstatus with flags
.
Sourcepub fn add_flags(&mut self, flags: RelayFlags) -> &mut Self
pub fn add_flags(&mut self, flags: RelayFlags) -> &mut Self
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 feature testing
only.
pub fn clear_flags(&mut self, flags: RelayFlags) -> &mut Self
testing
only.Make all the flags in flags
become cleared on this routerstatus.
Sourcepub fn version(&mut self, version: String) -> &mut Self
pub fn version(&mut self, version: String) -> &mut Self
Set the version of the relay described in this routerstatus.
This value is optional.
Sourcepub fn protos(&mut self, protos: Protocols) -> &mut Self
pub fn protos(&mut self, protos: Protocols) -> &mut Self
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
pub fn weight(&mut self, weight: RelayWeight) -> &mut Self
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<()>
pub fn build_into(&self, builder: &mut ConsensusBuilder) -> Result<()>
Try to finish this builder and add its RouterStatus to a provided ConsensusBuilder.x
Sourcepub fn build(&self) -> Result<RouterStatus>
pub fn build(&self) -> Result<RouterStatus>
Return a router status built by this object.
Trait Implementations§
Source§impl Clone for RouterStatusBuilder
impl Clone for RouterStatusBuilder
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