Struct wgpu_core::track::range::RangedStates
source · pub(crate) struct RangedStates<I, T> {
ranges: SmallVec<[(Range<I>, T); 1]>,
}
Expand description
Structure that keeps track of a I -> T mapping, optimized for a case where keys of the same values are often grouped together linearly.
Fields§
§ranges: SmallVec<[(Range<I>, T); 1]>
List of ranges, each associated with a singe value. Ranges of keys have to be non-intersecting and ordered.
Implementations§
source§impl<I: Copy + Ord, T: Copy + PartialEq> RangedStates<I, T>
impl<I: Copy + Ord, T: Copy + PartialEq> RangedStates<I, T>
pub fn from_range(range: Range<I>, value: T) -> Self
pub fn iter(&self) -> impl Iterator<Item = &(Range<I>, T)> + Clone
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut (Range<I>, T)>
pub fn iter_filter<'a>( &'a self, range: &'a Range<I>, ) -> impl Iterator<Item = (Range<I>, &'a T)> + 'a
Trait Implementations§
source§impl<I: Clone, T: Clone> Clone for RangedStates<I, T>
impl<I: Clone, T: Clone> Clone for RangedStates<I, T>
source§fn clone(&self) -> RangedStates<I, T>
fn clone(&self) -> RangedStates<I, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreimpl<I, T> StructuralPartialEq for RangedStates<I, T>
Auto Trait Implementations§
impl<I, T> Freeze for RangedStates<I, T>
impl<I, T> RefUnwindSafe for RangedStates<I, T>where
T: RefUnwindSafe,
I: RefUnwindSafe,
impl<I, T> Send for RangedStates<I, T>
impl<I, T> Sync for RangedStates<I, T>
impl<I, T> Unpin for RangedStates<I, T>
impl<I, T> UnwindSafe for RangedStates<I, T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)