pub trait Path<N>:
Display
+ Clone
+ Eq
+ PartialEq{
// Required method
fn hops(&self) -> &[N];
// Provided methods
fn length(&self) -> usize { ... }
fn last_hop(&self) -> &N { ... }
fn contains_cycle(&self) -> bool { ... }
}
Expand description
Base implementation of an abstract path. Must contain always at least a single entry.
Required Methods§
Provided Methods§
Sourcefn contains_cycle(&self) -> bool
fn contains_cycle(&self) -> bool
Checks if all the hops in this path are to distinct addresses.
Returns true
if there are duplicate Addresses on this path.
Note that the duplicate Addresses can never be adjacent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.