pub enum AxisLocation {
Vertex(usize),
Edge(usize, usize),
}Expand description
Variants§
Vertex(usize)
The axis passes through the element at this index.
Edge(usize, usize)
The axis passes between the elements at these two consecutive indices.
The invariant j == (i + 1) % n is maintained by AxisLocation::edge.
Implementations§
Source§impl AxisLocation
impl AxisLocation
Sourcepub fn edge(i: usize, n: usize) -> Self
pub fn edge(i: usize, n: usize) -> Self
Constructs an Edge between consecutive elements
of a ring of size n, starting at index i.
The second index is computed as (i + 1) % n.
§Panics
Panics if n is zero.
§Examples
use ring_seq::AxisLocation;
assert_eq!(AxisLocation::edge(2, 3), AxisLocation::Edge(2, 0));
assert_eq!(AxisLocation::edge(0, 4), AxisLocation::Edge(0, 1));Trait Implementations§
Source§impl Clone for AxisLocation
impl Clone for AxisLocation
Source§fn clone(&self) -> AxisLocation
fn clone(&self) -> AxisLocation
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 AxisLocation
impl Debug for AxisLocation
Source§impl Hash for AxisLocation
impl Hash for AxisLocation
Source§impl PartialEq for AxisLocation
impl PartialEq for AxisLocation
impl Copy for AxisLocation
impl Eq for AxisLocation
impl StructuralPartialEq for AxisLocation
Auto Trait Implementations§
impl Freeze for AxisLocation
impl RefUnwindSafe for AxisLocation
impl Send for AxisLocation
impl Sync for AxisLocation
impl Unpin for AxisLocation
impl UnsafeUnpin for AxisLocation
impl UnwindSafe for AxisLocation
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