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§
source§impl 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.
Trait Implementations§
source§impl Clone for PartialNetDir
impl Clone for PartialNetDir
source§fn clone(&self) -> PartialNetDir
fn clone(&self) -> PartialNetDir
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PartialNetDir
impl Debug for PartialNetDir
source§impl MdReceiver for PartialNetDir
impl MdReceiver for PartialNetDir
source§fn 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