pub enum BoundaryBehavior {
Clamp,
Reflect,
Absorb,
Wrap,
}Expand description
Boundary behavior when field values exceed declared bounds.
§Examples
use murk_core::BoundaryBehavior;
let behaviors = [
BoundaryBehavior::Clamp,
BoundaryBehavior::Reflect,
BoundaryBehavior::Absorb,
BoundaryBehavior::Wrap,
];
// All four variants are distinct.
for (i, a) in behaviors.iter().enumerate() {
for (j, b) in behaviors.iter().enumerate() {
assert_eq!(i == j, a == b);
}
}
// Copy semantics.
let a = BoundaryBehavior::Wrap;
let b = a;
assert_eq!(a, b);Variants§
Clamp
Clamp the value to the nearest bound.
Reflect
Reflect the value off the bound.
Absorb
Absorb at the boundary (value is set to the bound).
Wrap
Wrap around to the opposite bound.
Trait Implementations§
Source§impl Clone for BoundaryBehavior
impl Clone for BoundaryBehavior
Source§fn clone(&self) -> BoundaryBehavior
fn clone(&self) -> BoundaryBehavior
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 BoundaryBehavior
impl Debug for BoundaryBehavior
Source§impl PartialEq for BoundaryBehavior
impl PartialEq for BoundaryBehavior
impl Copy for BoundaryBehavior
impl Eq for BoundaryBehavior
impl StructuralPartialEq for BoundaryBehavior
Auto Trait Implementations§
impl Freeze for BoundaryBehavior
impl RefUnwindSafe for BoundaryBehavior
impl Send for BoundaryBehavior
impl Sync for BoundaryBehavior
impl Unpin for BoundaryBehavior
impl UnwindSafe for BoundaryBehavior
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