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(&mut self, prev: Arc<NetDir>)
pub fn fill_from_previous_netdir(&mut self, prev: Arc<NetDir>)
Record a previous netdir, which can be used for reusing cached information
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 more