Struct tor_netdoc::doc::netstatus::RouterStatusBuilder
source · [−]pub struct RouterStatusBuilder<D> { /* private fields */ }
Expand description
A Builder object for creating a RouterStatus and adding it to a consensus.
Implementations
sourceimpl<D: Clone> RouterStatusBuilder<D>
impl<D: Clone> RouterStatusBuilder<D>
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: D) -> &mut Self
pub fn doc_digest(&mut self, doc_digest: D) -> &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 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.
sourceimpl RouterStatusBuilder<RdDigest>
impl RouterStatusBuilder<RdDigest>
sourcepub fn build_into(
&self,
builder: &mut ConsensusBuilder<NsConsensusRouterStatus>
) -> Result<()>
pub fn build_into(
&self,
builder: &mut ConsensusBuilder<NsConsensusRouterStatus>
) -> Result<()>
Try to finish this builder and add its RouterStatus to a provided ConsensusBuilder.
sourcepub fn build(&self) -> Result<NsConsensusRouterStatus>
pub fn build(&self) -> Result<NsConsensusRouterStatus>
Return a router status built by this object.
sourceimpl RouterStatusBuilder<MdDigest>
impl RouterStatusBuilder<MdDigest>
sourcepub fn build_into(
&self,
builder: &mut ConsensusBuilder<MdConsensusRouterStatus>
) -> Result<()>
pub fn build_into(
&self,
builder: &mut ConsensusBuilder<MdConsensusRouterStatus>
) -> Result<()>
Try to finish this builder and add its RouterStatus to a provided ConsensusBuilder.x
sourcepub fn build(&self) -> Result<MdConsensusRouterStatus>
pub fn build(&self) -> Result<MdConsensusRouterStatus>
Return a router status built by this object.
Trait Implementations
sourceimpl<D: Clone> Clone for RouterStatusBuilder<D>
impl<D: Clone> Clone for RouterStatusBuilder<D>
sourcefn clone(&self) -> RouterStatusBuilder<D>
fn clone(&self) -> RouterStatusBuilder<D>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<D> RefUnwindSafe for RouterStatusBuilder<D> where
D: RefUnwindSafe,
impl<D> Send for RouterStatusBuilder<D> where
D: Send,
impl<D> Sync for RouterStatusBuilder<D> where
D: Sync,
impl<D> Unpin for RouterStatusBuilder<D> where
D: Unpin,
impl<D> UnwindSafe for RouterStatusBuilder<D> where
D: UnwindSafe,
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