Skip to main content

IdSet

Struct IdSet 

Source
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 }>

Source

pub(super) fn reset() -> &'static Self

The set of non-inherited longhands.

Source

pub(super) fn discrete_animatable() -> &'static Self

Source

pub(super) fn logical() -> &'static Self

Source

pub(super) fn ignored_when_colors_disabled() -> &'static Self

Returns the set of longhands that are ignored when document colors are disabled.

Source

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.

Source

pub(super) fn prioritary_properties() -> &'static Self

Source

pub(super) fn late_group_only_inherited() -> &'static Self

Source

pub(super) fn late_group() -> &'static Self

Source

pub fn margin_properties() -> &'static Self

Returns the set of margin properties, for the purposes of

use counters / warnings.

Source

pub fn border_background_properties() -> &'static Self

Returns the set of border properties for the purpose of disabling native appearance.

Source

pub fn zoom_dependent() -> &'static Self

Returns properties that are zoom dependent (basically, that contain lengths).

Source

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>

Source

pub fn new() -> Self

Creates an empty IdSet.

Source

pub(crate) const fn from_storage(storage: [u32; W]) -> Self

Creates a set from its raw bitfield storage.

Source

pub fn insert(&mut self, id: Id)

Insert an id in the set.

Source

pub fn remove(&mut self, id: Id)

Remove the given id from the set.

Source

pub fn contains(&self, id: Id) -> bool

Return whether the given id is in the set.

Source

pub fn iter(&self) -> IdSetIterator<'_, Id>

Iterate over the current id set.

Source

pub fn contains_all(&self, other: &Self) -> bool

Returns whether this set contains at least every id that other also contains.

Source

pub fn contains_any(&self, other: &Self) -> bool

Returns whether this set contains any id that other also contains.

Source

pub fn remove_all(&mut self, other: &Self)

Remove all the given ids from the set.

Source

pub fn clear(&mut self)

Clear all bits

Source

pub fn is_empty(&self) -> bool

Returns whether the set is empty.

Source§

impl IdSet<LonghandId, { (property_counts::LONGHANDS - 1 + 32) / 32 }>

Source

pub fn contains_any_reset(&self) -> bool

Return whether this set contains any reset longhand.

Trait Implementations§

Source§

impl<Id: IndexedId, const W: usize> Clone for IdSet<Id, W>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Id: IndexedId, const W: usize> Debug for IdSet<Id, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Id: IndexedId, const W: usize> Default for IdSet<Id, W>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Id: IndexedId, const W: usize> MallocSizeOf for IdSet<Id, W>

Source§

fn size_of(&self, _: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.
Source§

impl<Id: IndexedId, const W: usize> PartialEq for IdSet<Id, W>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T