pub enum MaybeSignal<T, S = SyncStorage>where
T: 'static,
S: Storage<T>,{
Static(T),
Dynamic(Signal<T, S>),
}๐Deprecated since 0.7.0-rc3:
MaybeSignal<T> is deprecated in favour of Signal<T> which is Copy, now has a more efficient From<T> implementation and other benefits in 0.7.Expand description
A wrapper for a value that is either T or Signal<T>.
This allows you to create APIs that take either a reactive or a non-reactive value of the same type. This is especially useful for component properties.
let (count, set_count) = signal(2);
let double_count = MaybeSignal::derive(move || count.get() * 2);
let memoized_double_count = Memo::new(move |_| count.get() * 2);
let static_value = 5;
// this function takes either a reactive or non-reactive value
fn above_3(arg: &MaybeSignal<i32>) -> bool {
// โ
calling the signal clones and returns the value
// it is a shorthand for arg.get()
arg.get() > 3
}
assert_eq!(above_3(&static_value.into()), true);
assert_eq!(above_3(&count.into()), false);
assert_eq!(above_3(&double_count), true);
assert_eq!(above_3(&memoized_double_count.into()), true);Variantsยง
Static(T)
๐Deprecated since 0.7.0-rc3:
MaybeSignal<T> is deprecated in favour of Signal<T> which is Copy, now has a more efficient From<T> implementation and other benefits in 0.7.An unchanging value of type T.
Dynamic(Signal<T, S>)
๐Deprecated since 0.7.0-rc3:
MaybeSignal<T> is deprecated in favour of Signal<T> which is Copy, now has a more efficient From<T> implementation and other benefits in 0.7.A reactive signal that contains a value of type T.
Implementationsยง
Sourceยงimpl<T> MaybeSignal<T>
impl<T> MaybeSignal<T>
Sourceยงimpl<T> MaybeSignal<T, LocalStorage>
impl<T> MaybeSignal<T, LocalStorage>
Sourcepub fn derive_local(
derived_signal: impl Fn() -> T + 'static,
) -> MaybeSignal<T, LocalStorage>
pub fn derive_local( derived_signal: impl Fn() -> T + 'static, ) -> MaybeSignal<T, LocalStorage>
Wraps a derived signal, i.e., any computation that accesses one or more reactive signals.
Trait Implementationsยง
Sourceยงimpl<V, S> AddAnyAttr for MaybeSignal<V, S>
impl<V, S> AddAnyAttr for MaybeSignal<V, S>
Sourceยงtype Output<SomeNewAttr: Attribute> = MaybeSignal<V, S>
type Output<SomeNewAttr: Attribute> = MaybeSignal<V, S>
The new type once the attribute has been added.
Sourceยงfn add_any_attr<NewAttr>(
self,
_attr: NewAttr,
) -> <MaybeSignal<V, S> as AddAnyAttr>::Output<NewAttr>where
NewAttr: Attribute,
fn add_any_attr<NewAttr>(
self,
_attr: NewAttr,
) -> <MaybeSignal<V, S> as AddAnyAttr>::Output<NewAttr>where
NewAttr: Attribute,
Adds an attribute to the view.
Sourceยงimpl<V, S> AttributeValue for MaybeSignal<V, S>where
V: AttributeValue + Send + Sync + Clone + 'static,
<V as AttributeValue>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> AttributeValue for MaybeSignal<V, S>where
V: AttributeValue + Send + Sync + Clone + 'static,
<V as AttributeValue>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type once all async data have loaded.
Sourceยงtype State = RenderEffect<<V as AttributeValue>::State>
type State = RenderEffect<<V as AttributeValue>::State>
The state that should be retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
A version of the value that can be cloned. This can be the same type, or a
reference-counted type. Generally speaking, this does not need to refer to the same data,
but should behave in the same way. So for example, making an event handler cloneable should
probably make it reference-counted (so that a
FnMut() continues mutating the same
closure), but making a String cloneable does not necessarily need to make it an
Arc<str>, as two different clones of a String will still have the same value.Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
A cloneable type that is also
'static. This is used for spreading across types when the
spreadable attribute needs to be owned. In some cases (&'a str to Arc<str>, etc.) the owned
cloneable type has worse performance than the cloneable type, so they are separate.Sourceยงfn to_template(_key: &str, _buf: &mut String)
fn to_template(_key: &str, _buf: &mut String)
Renders the attribute value to HTML for a
<template>.Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
key: &str,
el: &Element,
) -> <MaybeSignal<V, S> as AttributeValue>::State
fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <MaybeSignal<V, S> as AttributeValue>::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,
key: &str,
) -> <MaybeSignal<V, S> as AttributeValue>::State
fn build( self, el: &Element, key: &str, ) -> <MaybeSignal<V, S> as AttributeValue>::State
Adds this attribute to the element during client-side rendering.
Sourceยงfn rebuild(
self,
key: &str,
state: &mut <MaybeSignal<V, S> as AttributeValue>::State,
)
fn rebuild( self, key: &str, state: &mut <MaybeSignal<V, S> as AttributeValue>::State, )
Applies a new value for the attribute.
Sourceยงfn into_cloneable(self) -> <MaybeSignal<V, S> as AttributeValue>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as AttributeValue>::Cloneable
Converts this attribute into an equivalent that can be cloned.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as AttributeValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as AttributeValue>::CloneableOwned
Converts this attributes into an equivalent that can be cloned and is
'static.Sourceยงfn 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.
Sourceยงasync fn resolve(self) -> <MaybeSignal<V, S> as AttributeValue>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as AttributeValue>::AsyncOutput
โResolvesโ this into a form that is not waiting for any asynchronous data.
Sourceยงimpl<T, S> Clone for MaybeSignal<T, S>
impl<T, S> Clone for MaybeSignal<T, S>
Sourceยงfn clone(&self) -> MaybeSignal<T, S>
fn clone(&self) -> MaybeSignal<T, S>
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSourceยงimpl<T, S> Debug for MaybeSignal<T, S>
impl<T, S> Debug for MaybeSignal<T, S>
Sourceยงimpl<T, S> Default for MaybeSignal<T, S>
impl<T, S> Default for MaybeSignal<T, S>
Sourceยงfn default() -> MaybeSignal<T, S>
fn default() -> MaybeSignal<T, S>
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl<T, S> DefinedAt for MaybeSignal<T, S>where
S: Storage<T>,
impl<T, S> DefinedAt for MaybeSignal<T, S>where
S: Storage<T>,
Sourceยงfn defined_at(&self) -> Option<&'static Location<'static>>
fn defined_at(&self) -> Option<&'static Location<'static>>
Returns the location at which the signal was defined. This is usually simply
None in
release mode.Sourceยงimpl<'de, T, St> Deserialize<'de> for MaybeSignal<T, St>where
T: Deserialize<'de>,
St: Storage<T>,
impl<'de, T, St> Deserialize<'de> for MaybeSignal<T, St>where
T: Deserialize<'de>,
St: Storage<T>,
Sourceยงfn deserialize<D>(
deserializer: D,
) -> Result<MaybeSignal<T, St>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MaybeSignal<T, St>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Sourceยงimpl<T> From<ArcMemo<T>> for MaybeSignal<T>
impl<T> From<ArcMemo<T>> for MaybeSignal<T>
Sourceยงfn from(value: ArcMemo<T>) -> MaybeSignal<T>
fn from(value: ArcMemo<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<ArcReadSignal<T>> for MaybeSignal<T>
impl<T> From<ArcReadSignal<T>> for MaybeSignal<T>
Sourceยงfn from(value: ArcReadSignal<T>) -> MaybeSignal<T>
fn from(value: ArcReadSignal<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<ArcRwSignal<T>> for MaybeSignal<T>
impl<T> From<ArcRwSignal<T>> for MaybeSignal<T>
Sourceยงfn from(value: ArcRwSignal<T>) -> MaybeSignal<T>
fn from(value: ArcRwSignal<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<MaybeSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
impl<T> From<MaybeSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
Sourceยงfn from(
value: MaybeSignal<Option<T>, LocalStorage>,
) -> MaybeProp<T, LocalStorage>
fn from( value: MaybeSignal<Option<T>, LocalStorage>, ) -> MaybeProp<T, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<T> From<MaybeSignal<T>> for Signal<T>
impl<T> From<MaybeSignal<T>> for Signal<T>
Sourceยงfn from(value: MaybeSignal<T>) -> Signal<T>
fn from(value: MaybeSignal<T>) -> Signal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<MaybeSignal<T, LocalStorage>> for Signal<Option<T>, LocalStorage>
impl<T> From<MaybeSignal<T, LocalStorage>> for Signal<Option<T>, LocalStorage>
Sourceยงfn from(value: MaybeSignal<T, LocalStorage>) -> Signal<Option<T>, LocalStorage>
fn from(value: MaybeSignal<T, LocalStorage>) -> Signal<Option<T>, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<T> From<MaybeSignal<T, LocalStorage>> for Signal<T, LocalStorage>
impl<T> From<MaybeSignal<T, LocalStorage>> for Signal<T, LocalStorage>
Sourceยงfn from(value: MaybeSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from(value: MaybeSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<V, S> From<MaybeSignal<V, S>> for TextProp
impl<V, S> From<MaybeSignal<V, S>> for TextProp
Sourceยงfn from(s: MaybeSignal<V, S>) -> TextProp
fn from(s: MaybeSignal<V, S>) -> TextProp
Converts to this type from the input type.
Sourceยงimpl<T> From<Memo<T>> for MaybeSignal<T>
impl<T> From<Memo<T>> for MaybeSignal<T>
Sourceยงfn from(value: Memo<T>) -> MaybeSignal<T>
fn from(value: Memo<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<Memo<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
impl<T> From<Memo<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
Sourceยงfn from(value: Memo<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
fn from(value: Memo<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<T> From<ReadSignal<T>> for MaybeSignal<T>
impl<T> From<ReadSignal<T>> for MaybeSignal<T>
Sourceยงfn from(value: ReadSignal<T>) -> MaybeSignal<T>
fn from(value: ReadSignal<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<ReadSignal<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
impl<T> From<ReadSignal<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
Sourceยงfn from(value: ReadSignal<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
fn from(value: ReadSignal<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<T> From<RwSignal<T>> for MaybeSignal<T>
impl<T> From<RwSignal<T>> for MaybeSignal<T>
Sourceยงfn from(value: RwSignal<T>) -> MaybeSignal<T>
fn from(value: RwSignal<T>) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> From<RwSignal<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
impl<T> From<RwSignal<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
Sourceยงfn from(value: RwSignal<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
fn from(value: RwSignal<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
Converts to this type from the input type.
Sourceยงimpl<T, S> From<Signal<T, S>> for MaybeSignal<T, S>where
S: Storage<T>,
impl<T, S> From<Signal<T, S>> for MaybeSignal<T, S>where
S: Storage<T>,
Sourceยงfn from(value: Signal<T, S>) -> MaybeSignal<T, S>
fn from(value: Signal<T, S>) -> MaybeSignal<T, S>
Converts to this type from the input type.
Sourceยงimpl<T> From<T> for MaybeSignal<T>where
SyncStorage: Storage<T>,
impl<T> From<T> for MaybeSignal<T>where
SyncStorage: Storage<T>,
Sourceยงfn from(value: T) -> MaybeSignal<T>
fn from(value: T) -> MaybeSignal<T>
Converts to this type from the input type.
Sourceยงimpl<T> FromLocal<ArcMemo<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
impl<T> FromLocal<ArcMemo<T, LocalStorage>> for MaybeSignal<T, LocalStorage>
Sourceยงfn from_local(value: ArcMemo<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
fn from_local(value: ArcMemo<T, LocalStorage>) -> MaybeSignal<T, LocalStorage>
Converts between the types.
Sourceยงimpl<T> FromLocal<ArcReadSignal<T>> for MaybeSignal<T, LocalStorage>
impl<T> FromLocal<ArcReadSignal<T>> for MaybeSignal<T, LocalStorage>
Sourceยงfn from_local(value: ArcReadSignal<T>) -> MaybeSignal<T, LocalStorage>
fn from_local(value: ArcReadSignal<T>) -> MaybeSignal<T, LocalStorage>
Converts between the types.
Sourceยงimpl<T> FromLocal<ArcRwSignal<T>> for MaybeSignal<T, LocalStorage>where
T: 'static,
impl<T> FromLocal<ArcRwSignal<T>> for MaybeSignal<T, LocalStorage>where
T: 'static,
Sourceยงfn from_local(value: ArcRwSignal<T>) -> MaybeSignal<T, LocalStorage>
fn from_local(value: ArcRwSignal<T>) -> MaybeSignal<T, LocalStorage>
Converts between the types.
Sourceยงimpl<T> FromLocal<T> for MaybeSignal<T, LocalStorage>where
LocalStorage: Storage<T>,
impl<T> FromLocal<T> for MaybeSignal<T, LocalStorage>where
LocalStorage: Storage<T>,
Sourceยงfn from_local(value: T) -> MaybeSignal<T, LocalStorage>
fn from_local(value: T) -> MaybeSignal<T, LocalStorage>
Converts between the types.
Sourceยงimpl<V, S> InnerHtmlValue for MaybeSignal<V, S>where
V: InnerHtmlValue + Clone + Send + Sync + 'static,
<V as InnerHtmlValue>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> InnerHtmlValue for MaybeSignal<V, S>where
V: InnerHtmlValue + Clone + Send + Sync + 'static,
<V as InnerHtmlValue>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type after all async data have resolved.
Sourceยงtype State = RenderEffect<<V as InnerHtmlValue>::State>
type State = RenderEffect<<V as InnerHtmlValue>::State>
The view state retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
An equivalent value that can be cloned.
Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
An equivalent value that can be cloned and is
'static.Sourceยงfn to_template(_buf: &mut String)
fn to_template(_buf: &mut String)
Renders the class to HTML for a
<template>.Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <MaybeSignal<V, S> as InnerHtmlValue>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <MaybeSignal<V, S> as InnerHtmlValue>::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) -> <MaybeSignal<V, S> as InnerHtmlValue>::State
fn build(self, el: &Element) -> <MaybeSignal<V, S> as InnerHtmlValue>::State
Adds this class to the element during client-side rendering.
Sourceยงfn rebuild(self, state: &mut <MaybeSignal<V, S> as InnerHtmlValue>::State)
fn rebuild(self, state: &mut <MaybeSignal<V, S> as InnerHtmlValue>::State)
Updates the value.
Sourceยงfn into_cloneable(self) -> <MaybeSignal<V, S> as InnerHtmlValue>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as InnerHtmlValue>::Cloneable
Converts this to a cloneable type.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as InnerHtmlValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as InnerHtmlValue>::CloneableOwned
Converts this to a cloneable, owned type.
Sourceยงfn 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.
Sourceยงasync fn resolve(self) -> <MaybeSignal<V, S> as InnerHtmlValue>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as InnerHtmlValue>::AsyncOutput
โResolvesโ this into a type that is not waiting for any asynchronous data.
Sourceยงimpl<V, S> IntoClass for MaybeSignal<V, S>
impl<V, S> IntoClass for MaybeSignal<V, S>
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type after all async data have resolved.
Sourceยงtype State = RenderEffect<<V as IntoClass>::State>
type State = RenderEffect<<V as IntoClass>::State>
The view state retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
An equivalent value that can be cloned.
Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
An equivalent value that can be cloned and is
'static.Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <MaybeSignal<V, S> as IntoClass>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <MaybeSignal<V, S> as IntoClass>::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) -> <MaybeSignal<V, S> as IntoClass>::State
fn build(self, el: &Element) -> <MaybeSignal<V, S> as IntoClass>::State
Adds this class to the element during client-side rendering.
Sourceยงfn into_cloneable(self) -> <MaybeSignal<V, S> as IntoClass>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as IntoClass>::Cloneable
Converts this to a cloneable type.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as IntoClass>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as IntoClass>::CloneableOwned
Converts this to a cloneable, owned type.
Sourceยงfn 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.
Sourceยงasync fn resolve(self) -> <MaybeSignal<V, S> as IntoClass>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as IntoClass>::AsyncOutput
โResolvesโ this into a type that is not waiting for any asynchronous data.
Sourceยงfn reset(state: &mut <MaybeSignal<V, S> as IntoClass>::State)
fn reset(state: &mut <MaybeSignal<V, S> as IntoClass>::State)
Reset the class list to the state before this class was added.
Sourceยงconst MIN_LENGTH: usize = _
const MIN_LENGTH: usize = _
The minimum length of the HTML.
Sourceยงfn to_template(class: &mut String)
fn to_template(class: &mut String)
Renders the class to HTML for a
<template>.Sourceยงimpl<V, S> IntoProperty for MaybeSignal<V, S>where
V: IntoProperty + Clone + Send + Sync + 'static,
<V as IntoProperty>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> IntoProperty for MaybeSignal<V, S>where
V: IntoProperty + Clone + Send + Sync + 'static,
<V as IntoProperty>::State: 'static,
MaybeSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
Sourceยงtype State = RenderEffect<<V as IntoProperty>::State>
type State = RenderEffect<<V as IntoProperty>::State>
The view state retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
An equivalent value that can be cloned.
Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
An equivalent value that can be cloned and is
'static.Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
key: &str,
) -> <MaybeSignal<V, S> as IntoProperty>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, key: &str, ) -> <MaybeSignal<V, S> as IntoProperty>::State
Adds the property on an element created from HTML.
Sourceยงfn build(
self,
el: &Element,
key: &str,
) -> <MaybeSignal<V, S> as IntoProperty>::State
fn build( self, el: &Element, key: &str, ) -> <MaybeSignal<V, S> as IntoProperty>::State
Adds the property during client-side rendering.
Sourceยงfn rebuild(
self,
state: &mut <MaybeSignal<V, S> as IntoProperty>::State,
key: &str,
)
fn rebuild( self, state: &mut <MaybeSignal<V, S> as IntoProperty>::State, key: &str, )
Updates the property with a new value.
Sourceยงfn into_cloneable(self) -> <MaybeSignal<V, S> as IntoProperty>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as IntoProperty>::Cloneable
Converts this to a cloneable type.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as IntoProperty>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as IntoProperty>::CloneableOwned
Converts this to a cloneable, owned type.
Sourceยงimpl<V, S> IntoStyle for MaybeSignal<V, S>
impl<V, S> IntoStyle for MaybeSignal<V, S>
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type after all async data have resolved.
Sourceยงtype State = RenderEffect<<V as IntoStyle>::State>
type State = RenderEffect<<V as IntoStyle>::State>
The view state retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
An equivalent value that can be cloned.
Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
An equivalent value that can be cloned and is
'static.Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <MaybeSignal<V, S> as IntoStyle>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <MaybeSignal<V, S> as IntoStyle>::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) -> <MaybeSignal<V, S> as IntoStyle>::State
fn build(self, el: &Element) -> <MaybeSignal<V, S> as IntoStyle>::State
Adds this style to the element during client-side rendering.
Sourceยงfn into_cloneable(self) -> <MaybeSignal<V, S> as IntoStyle>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as IntoStyle>::Cloneable
Converts this to a cloneable type.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as IntoStyle>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as IntoStyle>::CloneableOwned
Converts this to a cloneable, owned type.
Sourceยงfn 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.
Sourceยงasync fn resolve(self) -> <MaybeSignal<V, S> as IntoStyle>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as IntoStyle>::AsyncOutput
โResolvesโ this into a type that is not waiting for any asynchronous data.
Sourceยงimpl<V, S> IntoStyleValue for MaybeSignal<V, S>
impl<V, S> IntoStyleValue for MaybeSignal<V, S>
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type after all async data have resolved.
Sourceยงtype State = (Arc<str>, RenderEffect<<V as IntoStyleValue>::State>)
type State = (Arc<str>, RenderEffect<<V as IntoStyleValue>::State>)
The view state retained between building and rebuilding.
Sourceยงtype Cloneable = MaybeSignal<V, S>
type Cloneable = MaybeSignal<V, S>
An equivalent value that can be cloned.
Sourceยงtype CloneableOwned = MaybeSignal<V, S>
type CloneableOwned = MaybeSignal<V, S>
An equivalent value that can be cloned and is
'static.Sourceยงfn build(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <MaybeSignal<V, S> as IntoStyleValue>::State
fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <MaybeSignal<V, S> as IntoStyleValue>::State
Adds this style to the element during client-side rendering.
Sourceยงfn rebuild(
self,
style: &CssStyleDeclaration,
name: &str,
state: &mut <MaybeSignal<V, S> as IntoStyleValue>::State,
)
fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <MaybeSignal<V, S> as IntoStyleValue>::State, )
Updates the value.
Sourceยงfn hydrate(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <MaybeSignal<V, S> as IntoStyleValue>::State
fn hydrate( self, style: &CssStyleDeclaration, name: &str, ) -> <MaybeSignal<V, S> as IntoStyleValue>::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 into_cloneable(self) -> <MaybeSignal<V, S> as IntoStyleValue>::Cloneable
fn into_cloneable(self) -> <MaybeSignal<V, S> as IntoStyleValue>::Cloneable
Converts this to a cloneable type.
Sourceยงfn into_cloneable_owned(
self,
) -> <MaybeSignal<V, S> as IntoStyleValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <MaybeSignal<V, S> as IntoStyleValue>::CloneableOwned
Converts this to a cloneable, owned type.
Sourceยงfn 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.
Sourceยงasync fn resolve(self) -> <MaybeSignal<V, S> as IntoStyleValue>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as IntoStyleValue>::AsyncOutput
โResolvesโ this into a type that is not waiting for any asynchronous data.
Sourceยงimpl<T, S> PartialEq for MaybeSignal<T, S>
impl<T, S> PartialEq for MaybeSignal<T, S>
Sourceยงimpl<T, S> ReadUntracked for MaybeSignal<T, S>
impl<T, S> ReadUntracked for MaybeSignal<T, S>
Sourceยงtype Value = ReadGuard<T, SignalReadGuard<T, S>>
type Value = ReadGuard<T, SignalReadGuard<T, S>>
The guard type that will be returned, which can be dereferenced to the value.
Sourceยงfn try_read_untracked(
&self,
) -> Option<<MaybeSignal<T, S> as ReadUntracked>::Value>
fn try_read_untracked( &self, ) -> Option<<MaybeSignal<T, S> as ReadUntracked>::Value>
Returns the guard, or
None if the signal has already been disposed.Sourceยงfn custom_try_read(
&self,
) -> Option<Option<<MaybeSignal<T, S> as ReadUntracked>::Value>>
fn custom_try_read( &self, ) -> Option<Option<<MaybeSignal<T, S> as ReadUntracked>::Value>>
This is a backdoor to allow overriding the
Read::try_read implementation despite it being auto implemented. Read moreSourceยงfn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Returns the guard. Read more
Sourceยงimpl<V, S> Render for MaybeSignal<V, S>
impl<V, S> Render for MaybeSignal<V, S>
Sourceยงimpl<V, S> RenderHtml for MaybeSignal<V, S>
impl<V, S> RenderHtml for MaybeSignal<V, S>
Sourceยงconst MIN_LENGTH: usize = 0
const MIN_LENGTH: usize = 0
The minimum length of HTML created when this view is rendered.
Sourceยงtype AsyncOutput = MaybeSignal<V, S>
type AsyncOutput = MaybeSignal<V, S>
The type of the view after waiting for all asynchronous data to load.
Sourceยงtype Owned = MaybeSignal<V, S>
type Owned = MaybeSignal<V, S>
An equivalent value that is
'static.Sourceยงfn dry_resolve(&mut self)
fn dry_resolve(&mut self)
โRunsโ the view 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ยงasync fn resolve(self) -> <MaybeSignal<V, S> as RenderHtml>::AsyncOutput
async fn resolve(self) -> <MaybeSignal<V, S> as RenderHtml>::AsyncOutput
Waits for any asynchronous sections of the view to load and returns the output.
Sourceยงfn html_len(&self) -> usize
fn html_len(&self) -> usize
An estimated length for this view, when rendered to HTML. Read more
Sourceยงfn to_html_with_buf(
self,
buf: &mut String,
position: &mut Position,
escape: bool,
mark_branches: bool,
extra_attrs: Vec<AnyAttribute>,
)
fn to_html_with_buf( self, buf: &mut String, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
Renders a view to HTML, writing it into the given buffer.
Sourceยงfn to_html_async_with_buf<const OUT_OF_ORDER: bool>(
self,
buf: &mut StreamBuilder,
position: &mut Position,
escape: bool,
mark_branches: bool,
extra_attrs: Vec<AnyAttribute>,
)where
MaybeSignal<V, S>: Sized,
fn to_html_async_with_buf<const OUT_OF_ORDER: bool>(
self,
buf: &mut StreamBuilder,
position: &mut Position,
escape: bool,
mark_branches: bool,
extra_attrs: Vec<AnyAttribute>,
)where
MaybeSignal<V, S>: Sized,
Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
Sourceยงfn hydrate<const FROM_SERVER: bool>(
self,
cursor: &Cursor,
position: &PositionState,
) -> <MaybeSignal<V, S> as Render>::State
fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <MaybeSignal<V, S> as Render>::State
Makes a set of DOM nodes rendered from HTML interactive. Read more
Sourceยงfn into_owned(self) -> <MaybeSignal<V, S> as RenderHtml>::Owned
fn into_owned(self) -> <MaybeSignal<V, S> as RenderHtml>::Owned
Convert into the equivalent value that is
'static.Sourceยงconst EXISTS: bool = true
const EXISTS: bool = true
Whether this should actually exist in the DOM, if it is the child of an element.
Sourceยงfn to_html_branching(self) -> Stringwhere
Self: Sized,
fn to_html_branching(self) -> Stringwhere
Self: Sized,
Renders a view to HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Sourceยงfn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an in-order stream of HTML.
Sourceยงfn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Sourceยงfn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an out-of-order stream of HTML.
Sourceยงfn to_html_stream_out_of_order_branching(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_out_of_order_branching(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Sourceยงfn hydrate_async(
self,
cursor: &Cursor,
position: &PositionState,
) -> impl Future<Output = Self::State>
fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> impl Future<Output = Self::State>
Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
Sourceยงfn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::Statewhere
Self: Sized,
fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::Statewhere
Self: Sized,
Hydrates using
RenderHtml::hydrate, beginning at the given element.Sourceยงfn hydrate_from_position<const FROM_SERVER: bool>(
self,
el: &Element,
position: Position,
) -> Self::Statewhere
Self: Sized,
fn hydrate_from_position<const FROM_SERVER: bool>(
self,
el: &Element,
position: Position,
) -> Self::Statewhere
Self: Sized,
Hydrates using
RenderHtml::hydrate, beginning at the given element and position.Sourceยงimpl<T, St> Serialize for MaybeSignal<T, St>
impl<T, St> Serialize for MaybeSignal<T, St>
Sourceยงfn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Sourceยงimpl<T, S> Track for MaybeSignal<T, S>
impl<T, S> Track for MaybeSignal<T, S>
impl<T, S> Copy for MaybeSignal<T, S>
impl<T, S> Eq for MaybeSignal<T, S>
impl<T, S> StructuralPartialEq for MaybeSignal<T, S>where
T: 'static,
S: Storage<T>,
Auto Trait Implementationsยง
impl<T, S> Freeze for MaybeSignal<T, S>where
T: Freeze,
impl<T, S> RefUnwindSafe for MaybeSignal<T, S>where
T: RefUnwindSafe,
impl<T, S> Send for MaybeSignal<T, S>where
T: Send,
impl<T, S> Sync for MaybeSignal<T, S>where
T: Sync,
impl<T, S> Unpin for MaybeSignal<T, S>where
T: Unpin,
impl<T, S> UnwindSafe for MaybeSignal<T, S>where
T: UnwindSafe,
Blanket Implementationsยง
Sourceยงimpl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for Vwhere
V: AddAnyAttr,
Key: AttributeKey,
Sig: IntoSplitSignal<Value = T>,
T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static,
Signal<BoolOrT<T>>: IntoProperty,
<Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static,
<Sig as IntoSplitSignal>::Write: Send + Clone + 'static,
Element: GetValue<T>,
impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for Vwhere
V: AddAnyAttr,
Key: AttributeKey,
Sig: IntoSplitSignal<Value = T>,
T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static,
Signal<BoolOrT<T>>: IntoProperty,
<Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static,
<Sig as IntoSplitSignal>::Write: Send + Clone + 'static,
Element: GetValue<T>,
Sourceยงtype Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>
type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>
The type of the element with the two-way binding added.
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T, K, V> CustomAttribute<K, V> for T
impl<T, K, V> CustomAttribute<K, V> for T
Sourceยงfn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>
fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>
Adds an HTML attribute by key and value.
Sourceยงimpl<V, T, P, D> DirectiveAttribute<T, P, D> for V
impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
Sourceยงtype Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>
type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>
The type of the element with the directive added.
Sourceยงfn directive(
self,
handler: D,
param: P,
) -> <V as DirectiveAttribute<T, P, D>>::Output
fn directive( self, handler: D, param: P, ) -> <V as DirectiveAttribute<T, P, D>>::Output
Adds a directive to the element, which runs some custom logic in the browser when the element
is created or hydrated.
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
Compare self to
key and return true if they are equal.Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> FromFormData for Twhere
T: DeserializeOwned,
impl<T> FromFormData for Twhere
T: DeserializeOwned,
Sourceยงfn from_event(ev: &Event) -> Result<T, FromFormDataError>
fn from_event(ev: &Event) -> Result<T, FromFormDataError>
Tries to deserialize the data, given only the
submit event.Sourceยงimpl<S, T> FromStream<T> for S
impl<S, T> FromStream<T> for S
Sourceยงfn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S
fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S
Creates a signal that contains the latest value of the stream.
Sourceยงfn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
Creates a signal that contains the latest value of the stream.
Sourceยงimpl<T> IntoAny for Twhere
T: Send + RenderHtml,
impl<T> IntoAny for Twhere
T: Send + RenderHtml,
Sourceยงimpl<T> IntoAttributeValue for Twhere
T: AttributeValue,
impl<T> IntoAttributeValue for Twhere
T: AttributeValue,
Sourceยงfn into_attribute_value(self) -> <T as IntoAttributeValue>::Output
fn into_attribute_value(self) -> <T as IntoAttributeValue>::Output
Consumes this value, transforming it into an attribute value.
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> IntoMaybeErased for Twhere
T: RenderHtml,
impl<T> IntoMaybeErased for Twhere
T: RenderHtml,
Sourceยงfn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output
fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output
Converts the view into a type-erased view if in erased mode.
Sourceยงimpl<T, S> IntoOptionGetter<T, SignalMarker> for S
impl<T, S> IntoOptionGetter<T, SignalMarker> for S
Sourceยงfn into_option_getter(self) -> OptionGetter<T>
fn into_option_getter(self) -> OptionGetter<T>
Converts the given value into an
OptionGetter.Sourceยงimpl<T> IntoRender for Twhere
T: Render,
impl<T> IntoRender for Twhere
T: Render,
Sourceยงfn into_render(self) -> <T as IntoRender>::Output
fn into_render(self) -> <T as IntoRender>::Output
Consumes this value, transforming it into the renderable type.
Sourceยงimpl<T> Read for Twhere
T: Track + ReadUntracked,
impl<T> Read for Twhere
T: Track + ReadUntracked,
Sourceยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
Sourceยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Sourceยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Sourceยงfn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.
Sourceยงimpl<T> With for Twhere
T: Read,
impl<T> With for Twhere
T: Read,
Sourceยงtype Value = <<T as Read>::Value as Deref>::Target
type Value = <<T as Read>::Value as Deref>::Target
The type of the value contained in the signal.
Sourceยงimpl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
impl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
Sourceยงtype Value = <<T as ReadUntracked>::Value as Deref>::Target
type Value = <<T as ReadUntracked>::Value as Deref>::Target
The type of the value contained in the signal.
Sourceยงfn try_with_untracked<U>(
&self,
fun: impl FnOnce(&<T as WithUntracked>::Value) -> U,
) -> Option<U>
fn try_with_untracked<U>( &self, fun: impl FnOnce(&<T as WithUntracked>::Value) -> U, ) -> Option<U>
Applies the closure to the value, and returns the result,
or
None if the signal has already been disposed.