pub struct SnapTarget { /* private fields */ }Expand description
A candidate location to which a pour point may be snapped.
Each SnapTarget belongs to exactly one drainage unit and carries a
proportional Weight used when multiple targets compete within the same
unit.
All fields are validated at construction time via their primitive newtypes;
SnapTarget itself performs no additional validation.
Implementations§
Source§impl SnapTarget
impl SnapTarget
Sourcepub fn new(
id: SnapId,
unit_id: UnitId,
weight: Weight,
stem_role: Option<StemRole>,
bbox: Option<BoundingBox>,
geometry: WkbGeometry,
) -> Self
pub fn new( id: SnapId, unit_id: UnitId, weight: Weight, stem_role: Option<StemRole>, bbox: Option<BoundingBox>, geometry: WkbGeometry, ) -> Self
Construct a SnapTarget from its constituent validated fields.
All arguments are already domain-typed, so no further validation is performed here — invalid states are unrepresentable by construction.
Sourcepub fn unit_id(&self) -> UnitId
pub fn unit_id(&self) -> UnitId
Return the identifier of the drainage unit this target belongs to.
Sourcepub fn weight(&self) -> Weight
pub fn weight(&self) -> Weight
Return the proportional weight used for allocation across competing targets.
Sourcepub fn bbox(&self) -> Option<&BoundingBox>
pub fn bbox(&self) -> Option<&BoundingBox>
Return a reference to the optional axis-aligned bounding box.
Sourcepub fn geometry(&self) -> &WkbGeometry
pub fn geometry(&self) -> &WkbGeometry
Return a reference to the WKB geometry of this snap target (typically a linestring or point).
Trait Implementations§
Source§impl Clone for SnapTarget
impl Clone for SnapTarget
Source§fn clone(&self) -> SnapTarget
fn clone(&self) -> SnapTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SnapTarget
impl Debug for SnapTarget
Source§impl PartialEq for SnapTarget
impl PartialEq for SnapTarget
Source§fn eq(&self, other: &SnapTarget) -> bool
fn eq(&self, other: &SnapTarget) -> bool
self and other values to be equal, and is used by ==.