pub struct IdSet<Id: IndexedId, const W: usize> {
storage: [u32; W],
_phantom: PhantomData<Id>,
}Expand description
A set of ids indexed in a bitfield. W is the number of u32 chunks needed to store
Id::COUNT bits, and is filled in by the type aliases above.
TODO(emilio): It’d be nice for the const parameter to be COUNT (or even not be there and pull from Id::COUNT), but that can’t be done in stable rust yet, see: https://github.com/rust-lang/rust/issues/76560
Fields§
§storage: [u32; W]§_phantom: PhantomData<Id>Implementations§
Source§impl IdSet<LonghandId, { (property_counts::LONGHANDS - 1 + 32) / 32 }>
impl IdSet<LonghandId, { (property_counts::LONGHANDS - 1 + 32) / 32 }>
pub(super) fn discrete_animatable() -> &'static Self
pub(super) fn logical() -> &'static Self
Sourcepub(super) fn ignored_when_colors_disabled() -> &'static Self
pub(super) fn ignored_when_colors_disabled() -> &'static Self
Returns the set of longhands that are ignored when document colors are disabled.
Sourcepub(super) fn visited_dependent() -> &'static Self
pub(super) fn visited_dependent() -> &'static Self
Only a few properties are allowed to depend on the visited state of links. When cascading visited styles, we can save time by only processing these properties.
pub(super) fn prioritary_properties() -> &'static Self
pub(super) fn late_group_only_inherited() -> &'static Self
pub(super) fn late_group() -> &'static Self
Sourcepub fn margin_properties() -> &'static Self
pub fn margin_properties() -> &'static Self
Returns the set of margin properties, for the purposes of
use counters / warnings.
Sourcepub fn border_background_properties() -> &'static Self
pub fn border_background_properties() -> &'static Self
Returns the set of border properties for the purpose of disabling native appearance.
Sourcepub fn zoom_dependent() -> &'static Self
pub fn zoom_dependent() -> &'static Self
Returns properties that are zoom dependent (basically, that contain lengths).
Sourcepub fn zoom_dependent_inherited_properties() -> &'static Self
pub fn zoom_dependent_inherited_properties() -> &'static Self
Note that it’s different from zoom_dependent(), as this only includes inherited, physical properties.
Source§impl<Id: IndexedId, const W: usize> IdSet<Id, W>
impl<Id: IndexedId, const W: usize> IdSet<Id, W>
Sourcepub(crate) const fn from_storage(storage: [u32; W]) -> Self
pub(crate) const fn from_storage(storage: [u32; W]) -> Self
Creates a set from its raw bitfield storage.
Sourcepub fn iter(&self) -> IdSetIterator<'_, Id> ⓘ
pub fn iter(&self) -> IdSetIterator<'_, Id> ⓘ
Iterate over the current id set.
Sourcepub fn contains_all(&self, other: &Self) -> bool
pub fn contains_all(&self, other: &Self) -> bool
Returns whether this set contains at least every id that other also contains.
Sourcepub fn contains_any(&self, other: &Self) -> bool
pub fn contains_any(&self, other: &Self) -> bool
Returns whether this set contains any id that other also contains.
Sourcepub fn remove_all(&mut self, other: &Self)
pub fn remove_all(&mut self, other: &Self)
Remove all the given ids from the set.
Source§impl IdSet<LonghandId, { (property_counts::LONGHANDS - 1 + 32) / 32 }>
impl IdSet<LonghandId, { (property_counts::LONGHANDS - 1 + 32) / 32 }>
Sourcepub fn contains_any_reset(&self) -> bool
pub fn contains_any_reset(&self) -> bool
Return whether this set contains any reset longhand.
Trait Implementations§
Source§impl<Id: IndexedId, const W: usize> MallocSizeOf for IdSet<Id, W>
impl<Id: IndexedId, const W: usize> MallocSizeOf for IdSet<Id, W>
Source§fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
fn size_of(&self, _: &mut MallocSizeOfOps) -> usize
impl<Id: IndexedId, const W: usize> Copy for IdSet<Id, W>
Auto Trait Implementations§
impl<Id, const W: usize> Freeze for IdSet<Id, W>
impl<Id, const W: usize> RefUnwindSafe for IdSet<Id, W>where
Id: RefUnwindSafe,
impl<Id, const W: usize> Send for IdSet<Id, W>where
Id: Send,
impl<Id, const W: usize> Sync for IdSet<Id, W>where
Id: Sync,
impl<Id, const W: usize> Unpin for IdSet<Id, W>where
Id: Unpin,
impl<Id, const W: usize> UnsafeUnpin for IdSet<Id, W>
impl<Id, const W: usize> UnwindSafe for IdSet<Id, W>where
Id: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more