Struct tor_netdir::PartialNetDir
source · [−]pub struct PartialNetDir { /* private fields */ }
Expand description
A partially build NetDir – it can’t be unwrapped until it has enough information to build safe paths.
Implementations
sourceimpl PartialNetDir
impl PartialNetDir
sourcepub fn new(
consensus: MdConsensus,
replacement_params: Option<&NetParams<i32>>
) -> Self
pub fn new(
consensus: MdConsensus,
replacement_params: Option<&NetParams<i32>>
) -> Self
Create a new PartialNetDir with a given consensus, and no microdescriptors loaded.
If replacement_params
is provided, override network parameters from
the consensus with those from replacement_params
.
sourcepub fn fill_from_previous_netdir<'a>(
&mut self,
prev: &'a NetDir
) -> Vec<&'a MdDigest>
pub fn fill_from_previous_netdir<'a>(
&mut self,
prev: &'a NetDir
) -> Vec<&'a MdDigest>
Fill in as many missing microdescriptors as possible in this netdir, using the microdescriptors from the previous netdir.
sourcepub fn have_enough_paths(&self) -> bool
pub fn have_enough_paths(&self) -> bool
Return true if this are enough information in this directory to build multihop paths.
sourcepub fn unwrap_if_sufficient(self) -> Result<NetDir, PartialNetDir>
pub fn unwrap_if_sufficient(self) -> Result<NetDir, PartialNetDir>
If this directory has enough information to build multihop circuits, return it.
sourcepub fn missing_descriptor_for(&self, rsa_id: &RsaIdentity) -> bool
pub fn missing_descriptor_for(&self, rsa_id: &RsaIdentity) -> bool
Return true if we are currently missing a microdescriptor for the given RSA identity.
A descriptor is missing
only if it is listed in the consensus,
but we don’t have it downloaded.
Trait Implementations
sourceimpl Clone for PartialNetDir
impl Clone for PartialNetDir
sourcefn clone(&self) -> PartialNetDir
fn clone(&self) -> PartialNetDir
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
sourceimpl Debug for PartialNetDir
impl Debug for PartialNetDir
sourceimpl MdReceiver for PartialNetDir
impl MdReceiver for PartialNetDir
sourcefn missing_microdescs(&self) -> Box<dyn Iterator<Item = &MdDigest> + '_>
fn missing_microdescs(&self) -> Box<dyn Iterator<Item = &MdDigest> + '_>
Return an iterator over the digests for all of the microdescriptors that this netdir is missing. Read more
sourcefn add_microdesc(&mut self, md: Microdesc) -> bool
fn add_microdesc(&mut self, md: Microdesc) -> bool
Add a microdescriptor to this netdir, if it was wanted. Read more
Auto Trait Implementations
impl RefUnwindSafe for PartialNetDir
impl Send for PartialNetDir
impl Sync for PartialNetDir
impl Unpin for PartialNetDir
impl UnwindSafe for PartialNetDir
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> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more