Skip to main content

InnerHtmlValue

Trait InnerHtmlValue 

Source
pub trait InnerHtmlValue: Send {
    type AsyncOutput: InnerHtmlValue;
    type State;
    type Cloneable: InnerHtmlValue + Clone;
    type CloneableOwned: InnerHtmlValue + Clone + 'static;

    // Required methods
    fn html_len(&self) -> usize;
    fn to_html(self, buf: &mut String);
    fn to_template(buf: &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;
}
Expand description

A possible value for InnerHtml.

Required Associated Types§

Source

type AsyncOutput: InnerHtmlValue

The type after all async data have resolved.

Source

type State

The view state retained between building and rebuilding.

Source

type Cloneable: InnerHtmlValue + Clone

An equivalent value that can be cloned.

Source

type CloneableOwned: InnerHtmlValue + Clone + 'static

An equivalent value that can be cloned and is 'static.

Required Methods§

Source

fn html_len(&self) -> usize

The estimated length of the HTML.

Source

fn to_html(self, buf: &mut String)

Renders the class to HTML.

Source

fn to_template(buf: &mut String)

Renders the class to HTML for a <template>.

Source

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>.

Source

fn build(self, el: &Element) -> Self::State

Adds this class to the element during client-side rendering.

Source

fn rebuild(self, state: &mut Self::State)

Updates the value.

Source

fn into_cloneable(self) -> Self::Cloneable

Converts this to a cloneable type.

Source

fn into_cloneable_owned(self) -> Self::CloneableOwned

Converts this to a cloneable, owned type.

Source

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.

Source

fn resolve(self) -> impl Future<Output = Self::AsyncOutput> + Send

“Resolves” this into a type that is not waiting for any asynchronous data.

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.

Implementations on Foreign Types§

Source§

impl InnerHtmlValue for &str

Source§

impl InnerHtmlValue for String

Source§

impl InnerHtmlValue for Arc<str>

Source§

impl<Inner, Prev> InnerHtmlValue for AtIndex<Inner, Prev>
where <Prev as Index<usize>>::Output: InnerHtmlValue + Clone + Send + Sync + 'static, <<Prev as Index<usize>>::Output as InnerHtmlValue>::State: 'static, AtIndex<Inner, Prev>: Get<Value = <Prev as Index<usize>>::Output>, Prev: Send + Sync + IndexMut<usize> + 'static, Inner: Send + Sync + Clone + 'static,

Source§

type AsyncOutput = AtIndex<Inner, Prev>

Source§

type State = RenderEffect<<<Prev as Index<usize>>::Output as InnerHtmlValue>::State>

Source§

type Cloneable = AtIndex<Inner, Prev>

Source§

type CloneableOwned = AtIndex<Inner, Prev>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <AtIndex<Inner, Prev> as InnerHtmlValue>::State

Source§

fn build(self, el: &Element) -> <AtIndex<Inner, Prev> as InnerHtmlValue>::State

Source§

fn rebuild(self, state: &mut <AtIndex<Inner, Prev> as InnerHtmlValue>::State)

Source§

fn into_cloneable(self) -> <AtIndex<Inner, Prev> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned( self, ) -> <AtIndex<Inner, Prev> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve(self) -> <AtIndex<Inner, Prev> as InnerHtmlValue>::AsyncOutput

Source§

impl<Inner, Prev, K, V> InnerHtmlValue for AtKeyed<Inner, Prev, K, V>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, AtKeyed<Inner, Prev, K, V>: Get<Value = V>, Prev: Send + Sync + 'static, Inner: Send + Sync + Clone + 'static, K: Send + Sync + Debug + Clone + 'static, &'a V: for<'a> IntoIterator,

Source§

type AsyncOutput = AtKeyed<Inner, Prev, K, V>

Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

Source§

type Cloneable = AtKeyed<Inner, Prev, K, V>

Source§

type CloneableOwned = AtKeyed<Inner, Prev, K, V>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::State

Source§

fn build( self, el: &Element, ) -> <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::State

Source§

fn rebuild( self, state: &mut <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::State, )

Source§

fn into_cloneable( self, ) -> <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned( self, ) -> <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve( self, ) -> <AtKeyed<Inner, Prev, K, V> as InnerHtmlValue>::AsyncOutput

Source§

impl<Inner, Prev, K, V> InnerHtmlValue for KeyedSubfield<Inner, Prev, K, V>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, KeyedSubfield<Inner, Prev, K, V>: Get<Value = V>, Prev: Send + Sync + 'static, Inner: Send + Sync + Clone + 'static, K: Send + Sync + Debug + Clone + 'static, &'a V: for<'a> IntoIterator,

Source§

type AsyncOutput = KeyedSubfield<Inner, Prev, K, V>

Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

Source§

type Cloneable = KeyedSubfield<Inner, Prev, K, V>

Source§

type CloneableOwned = KeyedSubfield<Inner, Prev, K, V>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::State

Source§

fn build( self, el: &Element, ) -> <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::State

Source§

fn rebuild( self, state: &mut <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::State, )

Source§

fn into_cloneable( self, ) -> <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned( self, ) -> <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve( self, ) -> <KeyedSubfield<Inner, Prev, K, V> as InnerHtmlValue>::AsyncOutput

Source§

impl<Inner, Prev, V> InnerHtmlValue for Subfield<Inner, Prev, V>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, Subfield<Inner, Prev, V>: Get<Value = V>, Prev: Send + Sync + 'static, Inner: Send + Sync + Clone + 'static,

Source§

type AsyncOutput = Subfield<Inner, Prev, V>

Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

Source§

type Cloneable = Subfield<Inner, Prev, V>

Source§

type CloneableOwned = Subfield<Inner, Prev, V>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <Subfield<Inner, Prev, V> as InnerHtmlValue>::State

Source§

fn build( self, el: &Element, ) -> <Subfield<Inner, Prev, V> as InnerHtmlValue>::State

Source§

fn rebuild( self, state: &mut <Subfield<Inner, Prev, V> as InnerHtmlValue>::State, )

Source§

fn into_cloneable( self, ) -> <Subfield<Inner, Prev, V> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned( self, ) -> <Subfield<Inner, Prev, V> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve( self, ) -> <Subfield<Inner, Prev, V> as InnerHtmlValue>::AsyncOutput

Source§

impl<S> InnerHtmlValue for DerefedField<S>
where <<S as StoreField>::Value as Deref>::Target: InnerHtmlValue + Clone + Send + Sync + 'static, <<<S as StoreField>::Value as Deref>::Target as InnerHtmlValue>::State: 'static, S: Clone + StoreField + Send + Sync + 'static, <S as StoreField>::Value: Deref + DerefMut,

Source§

impl<V> InnerHtmlValue for ArcField<V>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, ArcField<V>: Get<Value = V>,

Source§

impl<V> InnerHtmlValue for ArcStore<V>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, ArcStore<V>: Get<Value = V>,

Source§

impl<V, S> InnerHtmlValue for Field<V, S>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, Field<V, S>: Get<Value = V>, S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,

Source§

type AsyncOutput = Field<V, S>

Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

Source§

type Cloneable = Field<V, S>

Source§

type CloneableOwned = Field<V, S>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <Field<V, S> as InnerHtmlValue>::State

Source§

fn build(self, el: &Element) -> <Field<V, S> as InnerHtmlValue>::State

Source§

fn rebuild(self, state: &mut <Field<V, S> as InnerHtmlValue>::State)

Source§

fn into_cloneable(self) -> <Field<V, S> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned(self) -> <Field<V, S> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve(self) -> <Field<V, S> as InnerHtmlValue>::AsyncOutput

Source§

impl<V, S> InnerHtmlValue for Store<V, S>
where V: InnerHtmlValue + Clone + Send + Sync + 'static, <V as InnerHtmlValue>::State: 'static, Store<V, S>: Get<Value = V>, S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,

Source§

type AsyncOutput = Store<V, S>

Source§

type State = RenderEffect<<V as InnerHtmlValue>::State>

Source§

type Cloneable = Store<V, S>

Source§

type CloneableOwned = Store<V, S>

Source§

fn html_len(&self) -> usize

Source§

fn to_html(self, buf: &mut String)

Source§

fn to_template(_buf: &mut String)

Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <Store<V, S> as InnerHtmlValue>::State

Source§

fn build(self, el: &Element) -> <Store<V, S> as InnerHtmlValue>::State

Source§

fn rebuild(self, state: &mut <Store<V, S> as InnerHtmlValue>::State)

Source§

fn into_cloneable(self) -> <Store<V, S> as InnerHtmlValue>::Cloneable

Source§

fn into_cloneable_owned(self) -> <Store<V, S> as InnerHtmlValue>::CloneableOwned

Source§

fn dry_resolve(&mut self)

Source§

async fn resolve(self) -> <Store<V, S> as InnerHtmlValue>::AsyncOutput

Implementors§