pub struct RegionMap<T: Ord> { /* private fields */ }Expand description
A map from ID to rectangle, with hit-testing support.
Regions are tested in insertion order (via BTreeMap iteration). Explicitly pass a slice of IDs to control the hit-test order (e.g., reverse for topmost-first).
Implementations§
Source§impl<T: Ord> RegionMap<T>
impl<T: Ord> RegionMap<T>
pub fn new() -> Self
pub fn ids(&self) -> Vec<T>where
T: Copy,
pub fn set(&mut self, id: T, rect: LayoutRect)
pub fn get(&self, id: &T) -> Option<LayoutRect>
pub fn remove(&mut self, id: &T)
pub fn is_empty(&self) -> bool
pub fn contains_key(&self, id: &T) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RegionMap<T>
impl<T> RefUnwindSafe for RegionMap<T>where
T: RefUnwindSafe,
impl<T> Send for RegionMap<T>where
T: Send,
impl<T> Sync for RegionMap<T>where
T: Sync,
impl<T> Unpin for RegionMap<T>
impl<T> UnsafeUnpin for RegionMap<T>
impl<T> UnwindSafe for RegionMap<T>where
T: RefUnwindSafe,
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