pub struct Preamble {
pub consensus_methods: ConsensusMethods,
pub consensus_method: NotPresent,
pub published: (Iso8601TimeSp,),
pub lifetime: Lifetime,
pub voting_delay: Option<(u32, u32)>,
pub client_versions: Vec<String>,
pub server_versions: Vec<String>,
pub known_flags: DocRelayFlags,
pub proto_statuses: Arc<ProtoStatuses>,
pub params: NetParams<i32>,
pub shared_rand_previous_value: Option<SharedRandStatus>,
pub shared_rand_current_value: Option<SharedRandStatus>,
/* private fields */
}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§
§consensus_methods: ConsensusMethodsConsensus methods supported by this voter.
consensus_method: NotPresentWhat “method” was used to produce this consensus? (A consensus method is a version number used by authorities to upgrade the consensus algorithm.)
published: (Iso8601TimeSp,)Publication time (of a vote)
lifetime: LifetimeOver what time is this consensus valid? (For votes, this is the time over which the voted-upon consensus should be valid.)
voting_delay: Option<(u32, u32)>How long in seconds should voters wait for votes and signatures (respectively) to propagate?
client_versions: Vec<String>List of recommended Tor client versions.
server_versions: Vec<String>List of recommended Tor relay versions.
known_flags: DocRelayFlagsRouter flags which could be determined
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.
Global shared-random value for the previous shared-random period.
Global shared-random value for the current shared-random period.
Trait Implementations§
Source§impl From<PreambleConstructor> for Preamble
impl From<PreambleConstructor> for Preamble
Source§fn from(constructor: PreambleConstructor) -> Preamble
fn from(constructor: PreambleConstructor) -> Preamble
Source§impl NetdocEncodableFields for Preamble
impl NetdocEncodableFields for Preamble
Source§fn encode_fields(&self, out: &mut NetdocEncoder) -> Result<(), Bug>
fn encode_fields(&self, out: &mut NetdocEncoder) -> Result<(), Bug>
outSource§impl NetdocParseableFields for Preamble
impl NetdocParseableFields for Preamble
Source§type Accumulator = PreambleNetdocParseAccumulator
type Accumulator = PreambleNetdocParseAccumulator
Source§fn is_item_keyword(kw: KeywordRef<'_>) -> bool
fn is_item_keyword(kw: KeywordRef<'_>) -> bool
Source§fn accumulate_item(
acc: &mut Self::Accumulator,
item: UnparsedItem<'_>,
) -> Result<(), ErrorProblem>
fn accumulate_item( acc: &mut Self::Accumulator, item: UnparsedItem<'_>, ) -> Result<(), ErrorProblem>
Source§fn finish(acc: Self::Accumulator) -> Result<Self, ErrorProblem>
fn finish(acc: Self::Accumulator) -> Result<Self, ErrorProblem>
Auto Trait Implementations§
impl Freeze for Preamble
impl RefUnwindSafe for Preamble
impl Send for Preamble
impl Sync for Preamble
impl Unpin for Preamble
impl UnsafeUnpin 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