pub struct ReadSignal<T, S = SyncStorage> { /* private fields */ }Expand description
An arena-allocated getter for a reactive signal.
A signal is a piece of data that may change over time, and notifies other code when it has changed.
This is an arena-allocated signal, which is Copy and is disposed when its reactive
Owner cleans up. For a reference-counted signal that lives
as long as a reference to it is alive, see ArcReadSignal.
§Core Trait Implementations
.get()clones the current value of the signal. If you call it within an effect, it will cause that effect to subscribe to the signal, and to re-run whenever the value of the signal changes..get_untracked()clones the value of the signal without reactively tracking it.
.read()returns a guard that allows accessing the value of the signal by reference. If you call it within an effect, it will cause that effect to subscribe to the signal, and to re-run whenever the value of the signal changes..read_untracked()gives access to the current value of the signal without reactively tracking it.
.with()allows you to reactively access the signal’s value without cloning by applying a callback function..with_untracked()allows you to access the signal’s value by applying a callback function without reactively tracking it.
.to_stream()converts the signal to anasyncstream of values.::from_stream()converts anasyncstream of values into a signal containing the latest value.
§Examples
let (count, set_count) = signal(0);
// calling .get() clones and returns the value
assert_eq!(count.get(), 0);
// calling .read() accesses the value by reference
assert_eq!(count.read(), 0);Trait Implementations§
Source§impl<V, S> AddAnyAttr for ReadSignal<V, S>
impl<V, S> AddAnyAttr for ReadSignal<V, S>
Source§type Output<SomeNewAttr: Attribute> = ReadSignal<V, S>
type Output<SomeNewAttr: Attribute> = ReadSignal<V, S>
The new type once the attribute has been added.
Source§fn add_any_attr<NewAttr>(
self,
_attr: NewAttr,
) -> <ReadSignal<V, S> as AddAnyAttr>::Output<NewAttr>where
NewAttr: Attribute,
fn add_any_attr<NewAttr>(
self,
_attr: NewAttr,
) -> <ReadSignal<V, S> as AddAnyAttr>::Output<NewAttr>where
NewAttr: Attribute,
Adds an attribute to the view.
Source§impl<V, S> AttributeValue for ReadSignal<V, S>where
V: AttributeValue + Send + Sync + Clone + 'static,
<V as AttributeValue>::State: 'static,
ReadSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> AttributeValue for ReadSignal<V, S>where
V: AttributeValue + Send + Sync + Clone + 'static,
<V as AttributeValue>::State: 'static,
ReadSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
Source§type AsyncOutput = ReadSignal<V, S>
type AsyncOutput = ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<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 = ReadSignal<V, S>
type CloneableOwned = ReadSignal<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,
) -> <ReadSignal<V, S> as AttributeValue>::State
fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <ReadSignal<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,
) -> <ReadSignal<V, S> as AttributeValue>::State
fn build( self, el: &Element, key: &str, ) -> <ReadSignal<V, S> as AttributeValue>::State
Adds this attribute to the element during client-side rendering.
Source§fn rebuild(
self,
key: &str,
state: &mut <ReadSignal<V, S> as AttributeValue>::State,
)
fn rebuild( self, key: &str, state: &mut <ReadSignal<V, S> as AttributeValue>::State, )
Applies a new value for the attribute.
Source§fn into_cloneable(self) -> <ReadSignal<V, S> as AttributeValue>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as AttributeValue>::Cloneable
Converts this attribute into an equivalent that can be cloned.
Source§fn into_cloneable_owned(
self,
) -> <ReadSignal<V, S> as AttributeValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as AttributeValue>::AsyncOutput
async fn resolve(self) -> <ReadSignal<V, S> as AttributeValue>::AsyncOutput
“Resolves” this into a form that is not waiting for any asynchronous data.
Source§impl<T, S> Clone for ReadSignal<T, S>
impl<T, S> Clone for ReadSignal<T, S>
Source§fn clone(&self) -> ReadSignal<T, S>
fn clone(&self) -> ReadSignal<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 ReadSignal<T, S>where
S: Debug,
impl<T, S> Debug for ReadSignal<T, S>where
S: Debug,
Source§impl<T, S> DefinedAt for ReadSignal<T, S>
impl<T, S> DefinedAt for ReadSignal<T, S>
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<T, S> Dispose for ReadSignal<T, S>
impl<T, S> Dispose for ReadSignal<T, S>
Source§impl<T> From<ArcReadSignal<T>> for ReadSignal<T>
impl<T> From<ArcReadSignal<T>> for ReadSignal<T>
Source§fn from(value: ArcReadSignal<T>) -> ReadSignal<T>
fn from(value: ArcReadSignal<T>) -> ReadSignal<T>
Converts to this type from the input type.
Source§impl<T> From<ReadSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
impl<T> From<ReadSignal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
Source§fn from(
value: ReadSignal<Option<T>, LocalStorage>,
) -> MaybeProp<T, LocalStorage>
fn from( value: ReadSignal<Option<T>, LocalStorage>, ) -> MaybeProp<T, LocalStorage>
Converts to this type from the input type.
Source§impl<T> From<ReadSignal<T>> for MaybeProp<T>
impl<T> From<ReadSignal<T>> for MaybeProp<T>
Source§fn from(value: ReadSignal<T>) -> MaybeProp<T>
fn from(value: ReadSignal<T>) -> MaybeProp<T>
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>> for Signal<T>
impl<T> From<ReadSignal<T>> for Signal<T>
Source§fn from(value: ReadSignal<T>) -> Signal<T>
fn from(value: ReadSignal<T>) -> Signal<T>
Converts to this type from the input type.
Source§impl<T> From<ReadSignal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
impl<T> From<ReadSignal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
Source§fn from(value: ReadSignal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>
fn from(value: ReadSignal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>
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<ReadSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
impl<T> From<ReadSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
Source§fn from(value: ReadSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from(value: ReadSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
Converts to this type from the input type.
Source§impl<T, S> From<ReadSignal<T, S>> for ArcReadSignal<T>where
T: 'static,
S: Storage<ArcReadSignal<T>>,
impl<T, S> From<ReadSignal<T, S>> for ArcReadSignal<T>where
T: 'static,
S: Storage<ArcReadSignal<T>>,
Source§fn from(value: ReadSignal<T, S>) -> ArcReadSignal<T>
fn from(value: ReadSignal<T, S>) -> ArcReadSignal<T>
Converts to this type from the input type.
Source§impl<T, S> From<ReadSignal<T, S>> for ArcSignal<T, S>
impl<T, S> From<ReadSignal<T, S>> for ArcSignal<T, S>
Source§fn from(value: ReadSignal<T, S>) -> ArcSignal<T, S>
fn from(value: ReadSignal<T, S>) -> ArcSignal<T, S>
Converts to this type from the input type.
Source§impl<V, S> From<ReadSignal<V, S>> for TextProp
impl<V, S> From<ReadSignal<V, S>> for TextProp
Source§fn from(s: ReadSignal<V, S>) -> TextProp
fn from(s: ReadSignal<V, S>) -> TextProp
Converts to this type from the input type.
Source§impl<T> FromLocal<ArcReadSignal<T>> for ReadSignal<T, LocalStorage>where
T: 'static,
impl<T> FromLocal<ArcReadSignal<T>> for ReadSignal<T, LocalStorage>where
T: 'static,
Source§fn from_local(value: ArcReadSignal<T>) -> ReadSignal<T, LocalStorage>
fn from_local(value: ArcReadSignal<T>) -> ReadSignal<T, LocalStorage>
Converts between the types.
Source§impl<T, S> Hash for ReadSignal<T, S>
impl<T, S> Hash for ReadSignal<T, S>
Source§impl<V, S> InnerHtmlValue for ReadSignal<V, S>where
V: InnerHtmlValue + Clone + Send + Sync + 'static,
<V as InnerHtmlValue>::State: 'static,
ReadSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> InnerHtmlValue for ReadSignal<V, S>where
V: InnerHtmlValue + Clone + Send + Sync + 'static,
<V as InnerHtmlValue>::State: 'static,
ReadSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
Source§type AsyncOutput = ReadSignal<V, S>
type AsyncOutput = ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<V, S>
An equivalent value that can be cloned.
Source§type CloneableOwned = ReadSignal<V, S>
type CloneableOwned = ReadSignal<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,
) -> <ReadSignal<V, S> as InnerHtmlValue>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as InnerHtmlValue>::State
fn build(self, el: &Element) -> <ReadSignal<V, S> as InnerHtmlValue>::State
Adds this class to the element during client-side rendering.
Source§fn rebuild(self, state: &mut <ReadSignal<V, S> as InnerHtmlValue>::State)
fn rebuild(self, state: &mut <ReadSignal<V, S> as InnerHtmlValue>::State)
Updates the value.
Source§fn into_cloneable(self) -> <ReadSignal<V, S> as InnerHtmlValue>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as InnerHtmlValue>::Cloneable
Converts this to a cloneable type.
Source§fn into_cloneable_owned(
self,
) -> <ReadSignal<V, S> as InnerHtmlValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as InnerHtmlValue>::AsyncOutput
async fn resolve(self) -> <ReadSignal<V, S> as InnerHtmlValue>::AsyncOutput
“Resolves” this into a type that is not waiting for any asynchronous data.
Source§impl<V, S> IntoClass for ReadSignal<V, S>
impl<V, S> IntoClass for ReadSignal<V, S>
Source§type AsyncOutput = ReadSignal<V, S>
type AsyncOutput = ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<V, S>
An equivalent value that can be cloned.
Source§type CloneableOwned = ReadSignal<V, S>
type CloneableOwned = ReadSignal<V, S>
An equivalent value that can be cloned and is
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <ReadSignal<V, S> as IntoClass>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoClass>::State
fn build(self, el: &Element) -> <ReadSignal<V, S> as IntoClass>::State
Adds this class to the element during client-side rendering.
Source§fn into_cloneable(self) -> <ReadSignal<V, S> as IntoClass>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as IntoClass>::Cloneable
Converts this to a cloneable type.
Source§fn into_cloneable_owned(self) -> <ReadSignal<V, S> as IntoClass>::CloneableOwned
fn into_cloneable_owned(self) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoClass>::AsyncOutput
async fn resolve(self) -> <ReadSignal<V, S> as IntoClass>::AsyncOutput
“Resolves” this into a type that is not waiting for any asynchronous data.
Source§fn reset(state: &mut <ReadSignal<V, S> as IntoClass>::State)
fn reset(state: &mut <ReadSignal<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<T, S> IntoInner for ReadSignal<T, S>where
S: Storage<ArcReadSignal<T>>,
impl<T, S> IntoInner for ReadSignal<T, S>where
S: Storage<ArcReadSignal<T>>,
Source§impl<V, S> IntoProperty for ReadSignal<V, S>where
V: IntoProperty + Clone + Send + Sync + 'static,
<V as IntoProperty>::State: 'static,
ReadSignal<V, S>: Get<Value = V>,
S: Storage<V> + Storage<Option<V>> + Send + Sync + 'static,
impl<V, S> IntoProperty for ReadSignal<V, S>where
V: IntoProperty + Clone + Send + Sync + 'static,
<V as IntoProperty>::State: 'static,
ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<V, S>
An equivalent value that can be cloned.
Source§type CloneableOwned = ReadSignal<V, S>
type CloneableOwned = ReadSignal<V, S>
An equivalent value that can be cloned and is
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
key: &str,
) -> <ReadSignal<V, S> as IntoProperty>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, key: &str, ) -> <ReadSignal<V, S> as IntoProperty>::State
Adds the property on an element created from HTML.
Source§fn build(
self,
el: &Element,
key: &str,
) -> <ReadSignal<V, S> as IntoProperty>::State
fn build( self, el: &Element, key: &str, ) -> <ReadSignal<V, S> as IntoProperty>::State
Adds the property during client-side rendering.
Source§fn rebuild(
self,
state: &mut <ReadSignal<V, S> as IntoProperty>::State,
key: &str,
)
fn rebuild( self, state: &mut <ReadSignal<V, S> as IntoProperty>::State, key: &str, )
Updates the property with a new value.
Source§fn into_cloneable(self) -> <ReadSignal<V, S> as IntoProperty>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as IntoProperty>::Cloneable
Converts this to a cloneable type.
Source§fn into_cloneable_owned(
self,
) -> <ReadSignal<V, S> as IntoProperty>::CloneableOwned
fn into_cloneable_owned( self, ) -> <ReadSignal<V, S> as IntoProperty>::CloneableOwned
Converts this to a cloneable, owned type.
Source§impl<V, S> IntoStyle for ReadSignal<V, S>
impl<V, S> IntoStyle for ReadSignal<V, S>
Source§type AsyncOutput = ReadSignal<V, S>
type AsyncOutput = ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<V, S>
An equivalent value that can be cloned.
Source§type CloneableOwned = ReadSignal<V, S>
type CloneableOwned = ReadSignal<V, S>
An equivalent value that can be cloned and is
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <ReadSignal<V, S> as IntoStyle>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoStyle>::State
fn build(self, el: &Element) -> <ReadSignal<V, S> as IntoStyle>::State
Adds this style to the element during client-side rendering.
Source§fn into_cloneable(self) -> <ReadSignal<V, S> as IntoStyle>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as IntoStyle>::Cloneable
Converts this to a cloneable type.
Source§fn into_cloneable_owned(self) -> <ReadSignal<V, S> as IntoStyle>::CloneableOwned
fn into_cloneable_owned(self) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoStyle>::AsyncOutput
async fn resolve(self) -> <ReadSignal<V, S> as IntoStyle>::AsyncOutput
“Resolves” this into a type that is not waiting for any asynchronous data.
Source§impl<V, S> IntoStyleValue for ReadSignal<V, S>
impl<V, S> IntoStyleValue for ReadSignal<V, S>
Source§type AsyncOutput = ReadSignal<V, S>
type AsyncOutput = ReadSignal<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 = ReadSignal<V, S>
type Cloneable = ReadSignal<V, S>
An equivalent value that can be cloned.
Source§type CloneableOwned = ReadSignal<V, S>
type CloneableOwned = ReadSignal<V, S>
An equivalent value that can be cloned and is
'static.Source§fn build(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <ReadSignal<V, S> as IntoStyleValue>::State
fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <ReadSignal<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 <ReadSignal<V, S> as IntoStyleValue>::State,
)
fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <ReadSignal<V, S> as IntoStyleValue>::State, )
Updates the value.
Source§fn hydrate(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <ReadSignal<V, S> as IntoStyleValue>::State
fn hydrate( self, style: &CssStyleDeclaration, name: &str, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoStyleValue>::Cloneable
fn into_cloneable(self) -> <ReadSignal<V, S> as IntoStyleValue>::Cloneable
Converts this to a cloneable type.
Source§fn into_cloneable_owned(
self,
) -> <ReadSignal<V, S> as IntoStyleValue>::CloneableOwned
fn into_cloneable_owned( self, ) -> <ReadSignal<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) -> <ReadSignal<V, S> as IntoStyleValue>::AsyncOutput
async fn resolve(self) -> <ReadSignal<V, S> as IntoStyleValue>::AsyncOutput
“Resolves” this into a type that is not waiting for any asynchronous data.
Source§impl<T, S> IsDisposed for ReadSignal<T, S>
impl<T, S> IsDisposed for ReadSignal<T, S>
Source§fn is_disposed(&self) -> bool
fn is_disposed(&self) -> bool
If
true, the signal cannot be accessed without a panic.Source§impl<T, S> PartialEq for ReadSignal<T, S>
impl<T, S> PartialEq for ReadSignal<T, S>
Source§impl<T, S> ReadUntracked for ReadSignal<T, S>where
T: 'static,
S: Storage<ArcReadSignal<T>>,
impl<T, S> ReadUntracked for ReadSignal<T, S>where
T: 'static,
S: Storage<ArcReadSignal<T>>,
Source§type Value = ReadGuard<T, Plain<T>>
type Value = ReadGuard<T, Plain<T>>
The guard type that will be returned, which can be dereferenced to the value.
Source§fn try_read_untracked(
&self,
) -> Option<<ReadSignal<T, S> as ReadUntracked>::Value>
fn try_read_untracked( &self, ) -> Option<<ReadSignal<T, S> as ReadUntracked>::Value>
Returns the guard, or
None if the signal has already been disposed.Source§fn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Returns the guard. Read more
Source§fn custom_try_read(&self) -> Option<Option<Self::Value>>
fn custom_try_read(&self) -> Option<Option<Self::Value>>
This is a backdoor to allow overriding the
Read::try_read implementation despite it being auto implemented. Read moreSource§impl<V, S> Render for ReadSignal<V, S>
impl<V, S> Render for ReadSignal<V, S>
Source§impl<V, S> RenderHtml for ReadSignal<V, S>
impl<V, S> RenderHtml for ReadSignal<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 = ReadSignal<V, S>
type AsyncOutput = ReadSignal<V, S>
The type of the view after waiting for all asynchronous data to load.
Source§type Owned = ReadSignal<V, S>
type Owned = ReadSignal<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) -> <ReadSignal<V, S> as RenderHtml>::AsyncOutput
async fn resolve(self) -> <ReadSignal<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
ReadSignal<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
ReadSignal<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,
) -> <ReadSignal<V, S> as Render>::State
fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <ReadSignal<V, S> as Render>::State
Makes a set of DOM nodes rendered from HTML interactive. Read more
Source§fn into_owned(self) -> <ReadSignal<V, S> as RenderHtml>::Owned
fn into_owned(self) -> <ReadSignal<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 ReadSignal<T, St>
impl<T, St> Serialize for ReadSignal<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
impl<T, S> Copy for ReadSignal<T, S>
impl<T, S> Eq for ReadSignal<T, S>
Auto Trait Implementations§
impl<T, S> Freeze for ReadSignal<T, S>
impl<T, S> RefUnwindSafe for ReadSignal<T, S>
impl<T, S> Send for ReadSignal<T, S>
impl<T, S> Sync for ReadSignal<T, S>
impl<T, S> Unpin for ReadSignal<T, S>
impl<T, S> UnwindSafe for ReadSignal<T, S>
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<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> ReactiveNode for Twhere
T: AsSubscriberSet + DefinedAt,
impl<T> ReactiveNode for Twhere
T: AsSubscriberSet + DefinedAt,
Source§fn mark_dirty(&self)
fn mark_dirty(&self)
Notifies the source’s dependencies that it has changed.
Source§fn mark_check(&self)
fn mark_check(&self)
Notifies the source’s dependencies that it may have changed.
Source§fn mark_subscribers_check(&self)
fn mark_subscribers_check(&self)
Marks that all subscribers need to be checked.
Source§fn update_if_necessary(&self) -> bool
fn update_if_necessary(&self) -> bool
Regenerates the value for this node, if needed, and returns whether
it has actually changed or not.
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> Source for Twhere
T: AsSubscriberSet + DefinedAt,
impl<T> Source for Twhere
T: AsSubscriberSet + DefinedAt,
Source§fn clear_subscribers(&self)
fn clear_subscribers(&self)
Remove all subscribers from this source’s list of dependencies.
Source§fn add_subscriber(&self, subscriber: AnySubscriber)
fn add_subscriber(&self, subscriber: AnySubscriber)
Adds a subscriber to this source’s list of dependencies.
Source§fn remove_subscriber(&self, subscriber: &AnySubscriber)
fn remove_subscriber(&self, subscriber: &AnySubscriber)
Removes a subscriber from this source’s list of dependencies.
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.