pub enum EdgeBehavior {
Clamp,
Wrap,
Absorb,
}Expand description
How a lattice space handles neighbors at its edges.
This is distinct from murk_core::BoundaryBehavior, which controls
field value clamping. EdgeBehavior controls the topology — which
cells are considered neighbors of boundary cells.
§Examples
use murk_space::{Square4, EdgeBehavior, Space};
// Absorb: corner has 2 neighbors, interior has 4.
let absorb = Square4::new(4, 4, EdgeBehavior::Absorb).unwrap();
let corner: murk_core::Coord = vec![0i32, 0].into();
let interior: murk_core::Coord = vec![1i32, 1].into();
assert_eq!(absorb.neighbours(&corner).len(), 2);
assert_eq!(absorb.neighbours(&interior).len(), 4);
// Wrap: all cells have exactly 4 neighbors (torus).
let wrap = Square4::new(4, 4, EdgeBehavior::Wrap).unwrap();
assert_eq!(wrap.neighbours(&corner).len(), 4);Variants§
Clamp
Out-of-bounds neighbor maps to the boundary cell (self-loop).
Wrap
Out-of-bounds neighbor wraps to the opposite side (periodic).
Absorb
Out-of-bounds neighbor is omitted (fewer neighbors at edges).
Trait Implementations§
Source§impl Clone for EdgeBehavior
impl Clone for EdgeBehavior
Source§fn clone(&self) -> EdgeBehavior
fn clone(&self) -> EdgeBehavior
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 EdgeBehavior
impl Debug for EdgeBehavior
Source§impl Hash for EdgeBehavior
impl Hash for EdgeBehavior
Source§impl PartialEq for EdgeBehavior
impl PartialEq for EdgeBehavior
impl Copy for EdgeBehavior
impl Eq for EdgeBehavior
impl StructuralPartialEq for EdgeBehavior
Auto Trait Implementations§
impl Freeze for EdgeBehavior
impl RefUnwindSafe for EdgeBehavior
impl Send for EdgeBehavior
impl Sync for EdgeBehavior
impl Unpin for EdgeBehavior
impl UnsafeUnpin for EdgeBehavior
impl UnwindSafe for EdgeBehavior
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.