pub struct Weight(/* private fields */);Expand description
Snap ranking weight. Higher values indicate greater hydrological dominance; adapters typically populate this with upstream drainage area in km² or cell count. Snap-aware engines rank snap candidates by descending weight, using mainstem status and distance as tie-breakers.
Invariant: the wrapped value is always finite and non-negative.
Eq is intentionally not derived for the same reason as AreaKm2.
Implementations§
Source§impl Weight
impl Weight
Sourcepub fn new(raw: f32) -> Result<Self, MeasureError>
pub fn new(raw: f32) -> Result<Self, MeasureError>
Construct a Weight from a raw f32.
§Errors
| Condition | Error variant |
|---|---|
raw is NaN or infinite | MeasureError::NonFiniteValue |
raw < 0.0 | MeasureError::NegativeValue |
Trait Implementations§
Source§impl PartialOrd for Weight
impl PartialOrd for Weight
impl Copy for Weight
impl StructuralPartialEq for Weight
Auto Trait Implementations§
impl Freeze for Weight
impl RefUnwindSafe for Weight
impl Send for Weight
impl Sync for Weight
impl Unpin for Weight
impl UnsafeUnpin for Weight
impl UnwindSafe for Weight
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