pub struct NymRouteProvider {
pub topology: NymTopology,
pub ignore_egress_epoch_roles: bool,
}Fields§
§topology: NymTopology§ignore_egress_epoch_roles: boolAllow constructing routes with final hop at nodes that are not entry/exit gateways in the current epoch
Implementations§
Source§impl NymRouteProvider
impl NymRouteProvider
pub fn new( topology: NymTopology, ignore_egress_epoch_roles: bool, ) -> NymRouteProvider
pub fn current_key_rotation(&self) -> u32
pub fn absolute_epoch_id(&self) -> u32
pub fn metadata(&self) -> NymTopologyMetadata
pub fn new_empty(ignore_egress_epoch_roles: bool) -> NymRouteProvider
pub fn update(&mut self, new_topology: NymTopology)
pub fn clear_topology(&mut self)
pub fn with_ignore_egress_epoch_roles( self, ignore_egress_epoch_roles: bool, ) -> NymRouteProvider
pub fn ignore_egress_epoch_roles(&mut self, ignore_egress_epoch_roles: bool)
pub fn egress_by_identity( &self, node_identity: PublicKey, ) -> Result<&RoutingNode, NymTopologyError>
pub fn node_by_identity(&self, node_identity: PublicKey) -> Option<&RoutingNode>
Sourcepub fn random_route_to_egress<R>(
&self,
rng: &mut R,
egress_identity: PublicKey,
) -> Result<Vec<Node>, NymTopologyError>
pub fn random_route_to_egress<R>( &self, rng: &mut R, egress_identity: PublicKey, ) -> Result<Vec<Node>, NymTopologyError>
Tries to create a route to the egress point, such that it goes through mixnode on layer 1, mixnode on layer2, …. mixnode on layer n and finally the target egress, which can be any known node
Sourcepub fn empty_route_to_egress(
&self,
egress_identity: PublicKey,
) -> Result<Vec<Node>, NymTopologyError>
pub fn empty_route_to_egress( &self, egress_identity: PublicKey, ) -> Result<Vec<Node>, NymTopologyError>
Returns a route directly to the egress point, which can be any known node
pub fn random_path_to_egress<R>( &self, rng: &mut R, egress_identity: PublicKey, ) -> Result<(Vec<&RoutingNode>, &RoutingNode), NymTopologyError>
Trait Implementations§
Source§impl Clone for NymRouteProvider
impl Clone for NymRouteProvider
Source§fn clone(&self) -> NymRouteProvider
fn clone(&self) -> NymRouteProvider
Returns a duplicate 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 NymRouteProvider
impl Debug for NymRouteProvider
Source§impl Default for NymRouteProvider
impl Default for NymRouteProvider
Source§fn default() -> NymRouteProvider
fn default() -> NymRouteProvider
Returns the “default value” for a type. Read more
Source§impl From<NymTopology> for NymRouteProvider
impl From<NymTopology> for NymRouteProvider
Source§fn from(topology: NymTopology) -> NymRouteProvider
fn from(topology: NymTopology) -> NymRouteProvider
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NymRouteProvider
impl RefUnwindSafe for NymRouteProvider
impl Send for NymRouteProvider
impl Sync for NymRouteProvider
impl Unpin for NymRouteProvider
impl UnwindSafe for NymRouteProvider
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Deprecatable for T
impl<T> Deprecatable for T
fn deprecate(self) -> Deprecated<Self>where
Self: Sized,
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>
Converts
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>
Converts
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 moreSource§impl<T> OptionalSet for T
impl<T> OptionalSet for T
Source§fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
fn with_optional<F, T>(self, f: F, val: Option<T>) -> Self
If the value is available (i.e.
Some), the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_validated_optional<F, T, V, E>(
self,
f: F,
value: Option<T>,
validate: V,
) -> Result<Self, E>
fn with_validated_optional<F, T, V, E>( self, f: F, value: Option<T>, validate: V, ) -> Result<Self, E>
If the value is available (i.e.
Some) it is validated and then the provided closure is applied.
Otherwise self is returned with no modifications.Source§fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
fn with_optional_env<F, T>(self, f: F, val: Option<T>, env_var: &str) -> Self
If the value is available (i.e.
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the FromStr implementation and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.Source§fn with_optional_custom_env<F, T, G>(
self,
f: F,
val: Option<T>,
env_var: &str,
parser: G,
) -> Self
fn with_optional_custom_env<F, T, G>( self, f: F, val: Option<T>, env_var: &str, parser: G, ) -> Self
If the value is available (i.e.
Some), the provided closure is applied.
Otherwise, if the environment was configured and the corresponding variable was set,
the value is parsed using the provided parser and the closure is applied on that instead.
Finally, if none of those were available, self is returned with no modifications.