pub struct GeometricNode {
pub node: GossipNode,
pub position: (i32, i32),
}Expand description
A node with an Eisenstein lattice position.
Fields§
§node: GossipNode§position: (i32, i32)Position on the Eisenstein lattice
Implementations§
Source§impl GeometricNode
impl GeometricNode
pub fn new(id: &str, position: (i32, i32)) -> Self
Sourcepub fn distance_to(&self, other: &Self) -> i64
pub fn distance_to(&self, other: &Self) -> i64
Eisenstein distance to another node.
Sourcepub fn constraint_drift(&self) -> u64
pub fn constraint_drift(&self) -> u64
“Drift” — how far this node’s constraint state has diverged from origin. Higher drift = more constraints = more to share.
Trait Implementations§
Source§impl Clone for GeometricNode
impl Clone for GeometricNode
Source§fn clone(&self) -> GeometricNode
fn clone(&self) -> GeometricNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeometricNode
impl RefUnwindSafe for GeometricNode
impl Send for GeometricNode
impl Sync for GeometricNode
impl Unpin for GeometricNode
impl UnsafeUnpin for GeometricNode
impl UnwindSafe for GeometricNode
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