pub struct RouterStatusConstructor {
pub r: RouterStatusIntroItem,
pub m: NotPresent,
pub flags: DocRelayFlags,
pub protos: Protocols,
pub w: RelayBandwidthItem,
pub ed25519_id: NotPresent,
}Expand description
Constructor (required fields) for RouterStatus
See RouterStatus.
This constructor struct contains precisely the required fields.
You can make a RouterStatus out of it with .construct(),
or the From impl,
and use the result as a basis for further modifications.
§Example
let router_status = RouterStatus {
a: /* optional field value */,
version: /* optional field value */,
port_policy: /* optional field value */,
stats: /* optional field value */,
__non_exhaustive: /* optional field value */,
..RouterStatusConstructor {
r: /* required field value */,
m: /* required field value */,
flags: /* required field value */,
protos: /* required field value */,
w: /* required field value */,
ed25519_id: /* required field value */,
}.construct()
};Fields§
§r: RouterStatusIntroItemr — Introduce a routerstatus entry
https://spec.torproject.org/dir-spec/consensus-formats.html#item:r (and, the md version, which is different).
m: NotPresentm — Microdescriptor or document digest
In an md consensus, the hash of the document for this relay. In a vote, microdescriptor hashes for the various consensus methods.
https://spec.torproject.org/dir-spec/computing-consensus.html#flavor:microdesc
r item.
flags: DocRelayFlagss — Router status flags
https://spec.torproject.org/dir-spec/consensus-formats.html#item:s
protos: Protocolspr — Subprotocol capabilities supported
https://spec.torproject.org/dir-spec/consensus-formats.html#item:v
w: RelayBandwidthItemw — Bandwidth estimates
https://spec.torproject.org/dir-spec/consensus-formats.html#item:w
In Constructor, you can use RelayBandwidthItem::default()
if retain-unknown is enabled.
ed25519_id: NotPresentid — Relay’s (ed25519) identity
https://spec.torproject.org/dir-spec/consensus-formats.html#item:id
Implementations§
Source§impl RouterStatusConstructor
impl RouterStatusConstructor
Sourcepub fn construct(self) -> RouterStatus
pub fn construct(self) -> RouterStatus
Construct a minimal RouterStatus
In the returned RouterStatus,
optional fields all get the default values.
Trait Implementations§
Source§impl From<RouterStatusConstructor> for RouterStatus
impl From<RouterStatusConstructor> for RouterStatus
Source§fn from(constructor: RouterStatusConstructor) -> RouterStatus
fn from(constructor: RouterStatusConstructor) -> RouterStatus
Auto Trait Implementations§
impl Forget for RouterStatusConstructor
impl Freeze for RouterStatusConstructorwhere
u16: Freeze,
PhantomData<HashSet<String>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(String, ())>: Freeze,
*const ArcInner<ProtocolsInner> is !null: Freeze,
PhantomData<ArcInner<ProtocolsInner>>: Freeze,
PhantomData<Option<ParamValues<u32>>>: Freeze,
PhantomData<(String, u32)>: Freeze,
impl Move for RouterStatusConstructor
impl RefUnwindSafe for RouterStatusConstructor
impl Send for RouterStatusConstructor
impl Sync for RouterStatusConstructor
impl Unpin for RouterStatusConstructor
impl UnsafeUnpin for RouterStatusConstructorwhere
u16: UnsafeUnpin,
PhantomData<HashSet<String>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
*const ArcInner<ProtocolsInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ProtocolsInner>>: UnsafeUnpin,
PhantomData<Option<ParamValues<u32>>>: UnsafeUnpin,
PhantomData<(String, u32)>: UnsafeUnpin,
impl UnwindSafe for RouterStatusConstructorwhere
u16: UnwindSafe,
NonNull<u8>: UnwindSafe,
RawVecInner: UnwindSafe,
Arc<ProtocolsInner>: UnwindSafe,
HashMap<String, u32>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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