pub struct FixedLineString<const N: usize> { /* private fields */ }Expand description
A fixed-capacity polyline (open line string) backed by an inline array.
Stores up to N Point2D vertices with no heap allocation.
Implementations§
Source§impl<const N: usize> FixedLineString<N>
impl<const N: usize> FixedLineString<N>
Sourcepub fn push(&mut self, p: Point2D) -> Result<(), NoAllocError>
pub fn push(&mut self, p: Point2D) -> Result<(), NoAllocError>
Attempts to append a point. Returns Ok(()) on success or
Err(NoAllocError::CapacityExceeded) if full.
Sourcepub fn get(&self, index: usize) -> Option<&Point2D>
pub fn get(&self, index: usize) -> Option<&Point2D>
Returns the point at the given index, or None if out of bounds.
Sourcepub fn total_length(&self) -> f64
pub fn total_length(&self) -> f64
Computes the total length of the polyline (sum of segment lengths).
Returns 0.0 for line strings with fewer than 2 points.
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> Freeze for FixedLineString<N>
impl<const N: usize> RefUnwindSafe for FixedLineString<N>
impl<const N: usize> Send for FixedLineString<N>
impl<const N: usize> Sync for FixedLineString<N>
impl<const N: usize> Unpin for FixedLineString<N>
impl<const N: usize> UnsafeUnpin for FixedLineString<N>
impl<const N: usize> UnwindSafe for FixedLineString<N>
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