pub struct Constraint {
pub a: u32,
pub b: u32,
}Expand description
A constraint edge, as indices into the input point slice.
Held as a pair rather than as two points so the caller’s vertex identity survives the triangulation: a consumer that knows “edge 3 was my window head” can still find it in the output.
Fields§
§a: u32Index of the first endpoint.
b: u32Index of the second endpoint.
Implementations§
Source§impl Constraint
impl Constraint
Sourcepub fn new(a: u32, b: u32) -> Self
pub fn new(a: u32, b: u32) -> Self
Construct a constraint between two vertex indices.
Endpoints are stored in ascending order so that (a, b) and (b, a)
are the same constraint. An undirected edge compared directionally is
a classic source of “constraint lost” bugs that only appear when the
caller happens to list an edge the other way round.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§fn clone(&self) -> Constraint
fn clone(&self) -> Constraint
Returns a copy 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 Constraint
impl Debug for Constraint
Source§impl Ord for Constraint
impl Ord for Constraint
Source§fn cmp(&self, other: &Constraint) -> Ordering
fn cmp(&self, other: &Constraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
Source§impl PartialOrd for Constraint
impl PartialOrd for Constraint
impl Copy for Constraint
impl Eq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnwindSafe for Constraint
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