pub struct EdgeList { /* private fields */ }Expand description
The edge orchestra: many lines working in harmony
Managing one edge is simple, but glyphs have hundreds. This collection keeps them sorted by X position, making scanline traversal efficient. Whether we’re building the global edge table or managing active edges, this structure ensures every edge finds its place.
Implementations§
Source§impl EdgeList
impl EdgeList
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Room for everyone: pre-allocate space for efficiency
Sourcepub fn insert_sorted(&mut self, edge: Edge)
pub fn insert_sorted(&mut self, edge: Edge)
Find the perfect spot: insert while maintaining order
We use binary search to locate exactly where each edge belongs. No messy linear searches—just surgical precision.
Sourcepub fn remove_inactive(&mut self, y: i32)
pub fn remove_inactive(&mut self, y: i32)
Spring cleaning: remove edges that have finished their journey
Sourcepub fn as_mut_slice(&mut self) -> &mut [Edge]
pub fn as_mut_slice(&mut self) -> &mut [Edge]
Get edges as mutable slice.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EdgeList
impl RefUnwindSafe for EdgeList
impl Send for EdgeList
impl Sync for EdgeList
impl Unpin for EdgeList
impl UnsafeUnpin for EdgeList
impl UnwindSafe for EdgeList
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