Struct style::properties_and_values::registry::ScriptRegistry
source · pub struct ScriptRegistry {
properties: PrecomputedHashMap<Atom, PropertyRegistration>,
}
Expand description
The script registry of custom properties. https://drafts.css-houdini.org/css-properties-values-api-1/#dom-window-registeredpropertyset-slot
Fields§
§properties: PrecomputedHashMap<Atom, PropertyRegistration>
Implementations§
source§impl ScriptRegistry
impl ScriptRegistry
sourcepub fn get(&self, name: &Atom) -> Option<&PropertyRegistration>
pub fn get(&self, name: &Atom) -> Option<&PropertyRegistration>
Gets an already-registered custom property via script.
sourcepub fn properties(&self) -> &PrecomputedHashMap<Atom, PropertyRegistration>
pub fn properties(&self) -> &PrecomputedHashMap<Atom, PropertyRegistration>
Gets already-registered custom properties via script.
sourcepub fn register(&mut self, registration: PropertyRegistration)
pub fn register(&mut self, registration: PropertyRegistration)
Register a given property. As per https://drafts.css-houdini.org/css-properties-values-api-1/#the-registerproperty-function we don’t allow overriding the registration.
sourcepub fn get_all(&self) -> &PrecomputedHashMap<Atom, PropertyRegistration>
pub fn get_all(&self) -> &PrecomputedHashMap<Atom, PropertyRegistration>
Returns the properties hashmap.
Trait Implementations§
source§impl Default for ScriptRegistry
impl Default for ScriptRegistry
source§fn default() -> ScriptRegistry
fn default() -> ScriptRegistry
Returns the “default value” for a type. Read more
source§impl MallocSizeOf for ScriptRegistry
impl MallocSizeOf for ScriptRegistry
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl Freeze for ScriptRegistry
impl RefUnwindSafe for ScriptRegistry
impl Send for ScriptRegistry
impl Sync for ScriptRegistry
impl Unpin for ScriptRegistry
impl UnwindSafe for ScriptRegistry
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> 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>
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 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>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert