#[non_exhaustive]pub struct Preamble {
pub lifetime: Lifetime,
pub client_versions: Vec<String>,
pub server_versions: Vec<String>,
pub proto_statuses: Arc<ProtoStatuses>,
pub params: NetParams<i32>,
pub voting_delay: Option<(u32, u32)>,
pub consensus_method: u32,
pub shared_rand_previous_value: Option<SharedRandStatus>,
pub shared_rand_current_value: Option<SharedRandStatus>,
}plain-consensus only.Expand description
The preamble of a network status document, except for the intro and vote-status items.
https://spec.torproject.org/dir-spec/consensus-formats.html#section:preable
Does not include network-status-version and vote-status.
In the old parser this is not represented directly;
instead, in Consensus.flavor, there’s just the ConsensusFlavor.
parse2 doesn’t (currently) support subdocuments which contain the parent’s intro item
(ie, #[deftly(netdoc(flatten))] is not supported on the first field.)
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lifetime: LifetimeOver what time is this consensus valid? (For votes, this is the time over which the voted-upon consensus should be valid.)
client_versions: Vec<String>List of recommended Tor client versions.
server_versions: Vec<String>List of recommended Tor relay versions.
proto_statuses: Arc<ProtoStatuses>Lists of recommended and required subprotocols.
{recommended,required}-{client,relay}-protocols
params: NetParams<i32>Declared parameters for tunable settings about how to the network should operator. Some of these adjust timeouts and whatnot; some features things on and off.
voting_delay: Option<(u32, u32)>How long in seconds should voters wait for votes and signatures (respectively) to propagate?
consensus_method: u32What “method” was used to produce this consensus? (A consensus method is a version number used by authorities to upgrade the consensus algorithm.)
Global shared-random value for the previous shared-random period.
Global shared-random value for the current shared-random period.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Preamble
impl RefUnwindSafe for Preamble
impl Send for Preamble
impl Sync for Preamble
impl Unpin for Preamble
impl UnwindSafe for Preamble
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