pub enum Registration {
Define,
Decorator {
module: String,
name: String,
},
BaseClassDefine {
module: String,
name: String,
},
}Expand description
How a class is registered as a custom element (ADR 0020).
Registration::Define is unambiguous on its own. The other two only name the binding the registration goes
through; whether that binding registers anything depends on the library it comes from, which the caller decides
(lit/decorators.js registers with customElement, @stencil/core with Component).
Variants§
Define
customElements.define('x-y', Class), also through window.customElements, a variable holding the registry
(resolved by scope) or a new CustomElementRegistry(), and this in a static block of the class.
Decorator
A decorator of a top-level class, @name(…), @name or @ns.name(…), whose binding is imported from
module.
Fields
BaseClassDefine
A top-level class extends name imported from module (directly or as an argument of a mixin call,
extends Mixin(Base)), and Class.define(…) or Class.defineAsync(…) is called; or name.define(Class, …), the
static form on the imported class, is called with the class first.
Trait Implementations§
Source§impl Clone for Registration
impl Clone for Registration
Source§impl Debug for Registration
impl Debug for Registration
Source§impl<'de> Deserialize<'de> for Registration
impl<'de> Deserialize<'de> for Registration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Registration
Source§impl Hash for Registration
impl Hash for Registration
Source§impl PartialEq for Registration
impl PartialEq for Registration
Source§impl Serialize for Registration
impl Serialize for Registration
impl StructuralPartialEq for Registration
Auto Trait Implementations§
impl Forget for Registration
impl Freeze for Registration
impl Move for Registration
impl RefUnwindSafe for Registration
impl Send for Registration
impl Sync for Registration
impl Unpin for Registration
impl UnsafeUnpin for Registration
impl UnwindSafe for Registration
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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