pub trait IntoClass: Send {
type AsyncOutput: IntoClass;
type State;
type Cloneable: IntoClass + Clone;
type CloneableOwned: IntoClass + Clone + 'static;
const TEMPLATE: &'static str = "";
const MIN_LENGTH: usize = _;
// Required methods
fn html_len(&self) -> usize;
fn to_html(self, class: &mut String);
fn hydrate<const FROM_SERVER: bool>(self, el: &Element) -> Self::State;
fn build(self, el: &Element) -> Self::State;
fn rebuild(self, state: &mut Self::State);
fn into_cloneable(self) -> Self::Cloneable;
fn into_cloneable_owned(self) -> Self::CloneableOwned;
fn dry_resolve(&mut self);
fn resolve(self) -> impl Future<Output = Self::AsyncOutput> + Send;
fn reset(state: &mut Self::State);
// Provided method
fn to_template(class: &mut String) { ... }
}
Expand description
A possible value for a CSS class.
Provided Associated Constants§
Sourceconst MIN_LENGTH: usize = _
const MIN_LENGTH: usize = _
The minimum length of the HTML.
Required Associated Types§
Sourcetype AsyncOutput: IntoClass
type AsyncOutput: IntoClass
The type after all async data have resolved.
Sourcetype CloneableOwned: IntoClass + Clone + 'static
type CloneableOwned: IntoClass + Clone + 'static
An equivalent value that can be cloned and is 'static
.
Required Methods§
Sourcefn hydrate<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
fn hydrate<const FROM_SERVER: bool>(self, el: &Element) -> Self::State
Adds interactivity as necessary, given DOM nodes that were created from HTML that has
either been rendered on the server, or cloned for a <template>
.
Sourcefn build(self, el: &Element) -> Self::State
fn build(self, el: &Element) -> Self::State
Adds this class to the element during client-side rendering.
Sourcefn into_cloneable(self) -> Self::Cloneable
fn into_cloneable(self) -> Self::Cloneable
Converts this to a cloneable type.
Sourcefn into_cloneable_owned(self) -> Self::CloneableOwned
fn into_cloneable_owned(self) -> Self::CloneableOwned
Converts this to a cloneable, owned type.
Sourcefn dry_resolve(&mut self)
fn dry_resolve(&mut self)
“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Sourcefn resolve(self) -> impl Future<Output = Self::AsyncOutput> + Send
fn resolve(self) -> impl Future<Output = Self::AsyncOutput> + Send
“Resolves” this into a type that is not waiting for any asynchronous data.
Provided Methods§
Sourcefn to_template(class: &mut String)
fn to_template(class: &mut String)
Renders the class to HTML for a <template>
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.