pub struct Signal<T, S = SyncStorage>where
S: Storage<T>,{ /* private fields */ }Expand description
A wrapper for any kind of arena-allocated reactive signal:
a ReadSignal, Memo, RwSignal, or derived signal closure,
or a plain value of the same type
This allows you to create APIs that take T or any reactive value that returns T
as an argument, rather than adding a generic F: Fn() -> T.
Values can be accessed with the same function call, read(), with(), and get()
APIs as other signals.
§Important Notes about Derived Signals
Signal::derive() is simply a way to box and type-erase a “derived signal,” which
is a plain closure that accesses one or more signals. It does not cache the value
of that computation. Accessing the value of a Signal<_> that is created using Signal::derive()
will run the closure again every time you call .read(), .with(), or .get().
If you want the closure to run the minimal number of times necessary to update its state,
and then to cache its value, you should use a Memo (and convert it into a Signal<_>)
rather than using Signal::derive().
Note that for many computations, it is nevertheless less expensive to use a derived signal than to create a separate memo and to cache the value: creating a new reactive node and taking the lock on that cached value whenever you access the signal is more expensive than simply re-running the calculation in many cases.
Implementations§
Source§impl<T> Signal<T>
impl<T> Signal<T>
Sourcepub fn derive(
derived_signal: impl Fn() -> T + Send + Sync + 'static,
) -> Signal<T>
pub fn derive( derived_signal: impl Fn() -> T + Send + Sync + 'static, ) -> Signal<T>
Wraps a derived signal, i.e., any computation that accesses one or more reactive signals.
let (count, set_count) = signal(2);
let double_count = Signal::derive(move || count.get() * 2);
// this function takes any kind of wrapped signal
fn above_3(arg: &Signal<i32>) -> bool {
arg.get() > 3
}
assert_eq!(above_3(&count.into()), false);
assert_eq!(above_3(&double_count), true);Sourcepub fn stored(value: T) -> Signal<T>
pub fn stored(value: T) -> Signal<T>
Moves a static, nonreactive value into a signal, backed by ArcStoredValue.
Source§impl<T> Signal<T, LocalStorage>where
T: 'static,
impl<T> Signal<T, LocalStorage>where
T: 'static,
Sourcepub fn derive_local(
derived_signal: impl Fn() -> T + 'static,
) -> Signal<T, LocalStorage>
pub fn derive_local( derived_signal: impl Fn() -> T + 'static, ) -> Signal<T, LocalStorage>
Wraps a derived signal. Works like Signal::derive but uses LocalStorage.
Sourcepub fn stored_local(value: T) -> Signal<T, LocalStorage>
pub fn stored_local(value: T) -> Signal<T, LocalStorage>
Moves a static, nonreactive value into a signal, backed by ArcStoredValue.
Works like Signal::stored but uses LocalStorage.
Trait Implementations§
impl<T, S> Copy for Signal<T, S>where
S: Storage<T>,
Source§impl<T, S> DefinedAt for Signal<T, S>where
S: Storage<T>,
impl<T, S> DefinedAt for Signal<T, S>where
S: Storage<T>,
Source§fn defined_at(&self) -> Option<&'static Location<'static>>
fn defined_at(&self) -> Option<&'static Location<'static>>
None in
release mode.Source§impl<'de, T> Deserialize<'de> for Signal<T>
impl<'de, T> Deserialize<'de> for Signal<T>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Signal<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Signal<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl<T, S> Eq for Signal<T, S>where
S: Storage<T>,
Source§impl<T, S> FnMut() for Signal<T, S>
Available on rustc_nightly and crate feature nightly only.
impl<T, S> FnMut() for Signal<T, S>
rustc_nightly and crate feature nightly only.Source§impl<T, S> FnOnce() for Signal<T, S>
Available on rustc_nightly and crate feature nightly only.
impl<T, S> FnOnce() for Signal<T, S>
rustc_nightly and crate feature nightly only.Source§impl<T> From<ArcMappedSignal<T>> for Signal<T>
impl<T> From<ArcMappedSignal<T>> for Signal<T>
Source§fn from(value: ArcMappedSignal<T>) -> Signal<T>
fn from(value: ArcMappedSignal<T>) -> Signal<T>
Source§impl<T> From<ArcMemo<T, LocalStorage>> for Signal<T, LocalStorage>
impl<T> From<ArcMemo<T, LocalStorage>> for Signal<T, LocalStorage>
Source§fn from(value: ArcMemo<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from(value: ArcMemo<T, LocalStorage>) -> Signal<T, LocalStorage>
Source§impl<T> From<ArcReadSignal<T>> for Signal<T>
impl<T> From<ArcReadSignal<T>> for Signal<T>
Source§fn from(value: ArcReadSignal<T>) -> Signal<T>
fn from(value: ArcReadSignal<T>) -> Signal<T>
Source§impl<T> From<ArcReadSignal<T>> for Signal<T, LocalStorage>
impl<T> From<ArcReadSignal<T>> for Signal<T, LocalStorage>
Source§fn from(value: ArcReadSignal<T>) -> Signal<T, LocalStorage>
fn from(value: ArcReadSignal<T>) -> Signal<T, LocalStorage>
Source§impl<T> From<ArcRwSignal<T>> for Signal<T>
impl<T> From<ArcRwSignal<T>> for Signal<T>
Source§fn from(value: ArcRwSignal<T>) -> Signal<T>
fn from(value: ArcRwSignal<T>) -> Signal<T>
Source§impl<T> From<ArcRwSignal<T>> for Signal<T, LocalStorage>
impl<T> From<ArcRwSignal<T>> for Signal<T, LocalStorage>
Source§fn from(value: ArcRwSignal<T>) -> Signal<T, LocalStorage>
fn from(value: ArcRwSignal<T>) -> Signal<T, LocalStorage>
Source§impl<T> From<MappedSignal<T>> for Signal<T>
impl<T> From<MappedSignal<T>> for Signal<T>
Source§fn from(value: MappedSignal<T>) -> Signal<T>
fn from(value: MappedSignal<T>) -> Signal<T>
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>
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>
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>
Source§impl<T> From<Memo<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
impl<T> From<Memo<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
Source§fn from(value: Memo<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from(value: Memo<T, LocalStorage>) -> Signal<T, LocalStorage>
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>
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>
Source§impl<T> From<RwSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
impl<T> From<RwSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
Source§fn from(value: RwSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from(value: RwSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
Source§impl From<Signal<&'static str, LocalStorage>> for Signal<String, LocalStorage>
impl From<Signal<&'static str, LocalStorage>> for Signal<String, LocalStorage>
Source§fn from(
value: Signal<&'static str, LocalStorage>,
) -> Signal<String, LocalStorage>
fn from( value: Signal<&'static str, LocalStorage>, ) -> Signal<String, LocalStorage>
Source§impl From<Signal<Option<&'static str>, LocalStorage>> for Signal<Option<String>, LocalStorage>
impl From<Signal<Option<&'static str>, LocalStorage>> for Signal<Option<String>, LocalStorage>
Source§impl<T> From<Signal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
impl<T> From<Signal<Option<T>, LocalStorage>> for MaybeProp<T, LocalStorage>
Source§fn from(value: Signal<Option<T>, LocalStorage>) -> MaybeProp<T, LocalStorage>
fn from(value: Signal<Option<T>, LocalStorage>) -> MaybeProp<T, LocalStorage>
Source§impl<T> From<Signal<T, LocalStorage>> for Signal<Option<T>, LocalStorage>where
T: Clone + 'static,
impl<T> From<Signal<T, LocalStorage>> for Signal<Option<T>, LocalStorage>where
T: Clone + 'static,
Source§fn from(value: Signal<T, LocalStorage>) -> Signal<Option<T>, LocalStorage>
fn from(value: Signal<T, LocalStorage>) -> Signal<Option<T>, LocalStorage>
Source§impl<T> From<Signal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
impl<T> From<Signal<T, LocalStorage>> for MaybeProp<T, LocalStorage>
Source§fn from(value: Signal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>
fn from(value: Signal<T, LocalStorage>) -> MaybeProp<T, LocalStorage>
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>
Source§impl<T> From<T> for Signal<T, LocalStorage>where
T: 'static,
impl<T> From<T> for Signal<T, LocalStorage>where
T: 'static,
Source§fn from(value: T) -> Signal<T, LocalStorage>
fn from(value: T) -> Signal<T, LocalStorage>
Source§impl<T> FromLocal<ArcSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
impl<T> FromLocal<ArcSignal<T, LocalStorage>> for Signal<T, LocalStorage>where
T: 'static,
Source§fn from_local(value: ArcSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
fn from_local(value: ArcSignal<T, LocalStorage>) -> Signal<T, LocalStorage>
Source§impl<T, S> PartialEq for Signal<T, S>where
S: Storage<T>,
impl<T, S> PartialEq for Signal<T, S>where
S: Storage<T>,
Source§impl<T, S> ReadUntracked for Signal<T, S>
impl<T, S> ReadUntracked for Signal<T, S>
Source§fn custom_try_read(
&self,
) -> Option<Option<<Signal<T, S> as ReadUntracked>::Value>>
fn custom_try_read( &self, ) -> Option<Option<<Signal<T, S> as ReadUntracked>::Value>>
Overriding the default auto implemented Read::try_read to combine read and track,
to avoid 2 clones and just have 1 in the SignalTypes::DerivedSignal.
Source§type Value = ReadGuard<T, SignalReadGuard<T, S>>
type Value = ReadGuard<T, SignalReadGuard<T, S>>
Source§fn try_read_untracked(&self) -> Option<<Signal<T, S> as ReadUntracked>::Value>
fn try_read_untracked(&self) -> Option<<Signal<T, S> as ReadUntracked>::Value>
None if the signal has already been disposed.Source§fn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Source§impl<T, St> Serialize for Signal<T, St>
impl<T, St> Serialize for Signal<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,
Auto Trait Implementations§
impl<T, S> Freeze for Signal<T, S>
impl<T, S> RefUnwindSafe for Signal<T, S>
impl<T, S> Send for Signal<T, S>
impl<T, S> Sync for Signal<T, S>
impl<T, S> Unpin for Signal<T, S>
impl<T, S> UnsafeUnpin for Signal<T, S>
impl<T, S> UnwindSafe for Signal<T, S>
Blanket Implementations§
Source§impl<F, V> AddAnyAttr for Fwhere
F: ReactiveFunction<Output = V>,
V: RenderHtml + 'static,
impl<F, V> AddAnyAttr for Fwhere
F: ReactiveFunction<Output = V>,
V: RenderHtml + 'static,
Source§type Output<SomeNewAttr: Attribute> = Box<dyn FnMut() -> <V as AddAnyAttr>::Output<<SomeNewAttr as Attribute>::CloneableOwned> + Send>
type Output<SomeNewAttr: Attribute> = Box<dyn FnMut() -> <V as AddAnyAttr>::Output<<SomeNewAttr as Attribute>::CloneableOwned> + Send>
Source§fn add_any_attr<NewAttr>(
self,
attr: NewAttr,
) -> <F as AddAnyAttr>::Output<NewAttr>
fn add_any_attr<NewAttr>( self, attr: NewAttr, ) -> <F as AddAnyAttr>::Output<NewAttr>
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<F, V> AttributeValue for Fwhere
F: ReactiveFunction<Output = V>,
V: AttributeValue + 'static,
<V as AttributeValue>::State: 'static,
impl<F, V> AttributeValue for Fwhere
F: ReactiveFunction<Output = V>,
V: AttributeValue + 'static,
<V as AttributeValue>::State: 'static,
Source§type AsyncOutput = <V as AttributeValue>::AsyncOutput
type AsyncOutput = <V as AttributeValue>::AsyncOutput
Source§type State = RenderEffect<<V as AttributeValue>::State>
type State = RenderEffect<<V as AttributeValue>::State>
Source§type Cloneable = Arc<Mutex<dyn FnMut() -> V + Send>>
type Cloneable = Arc<Mutex<dyn FnMut() -> V + Send>>
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 = Arc<Mutex<dyn FnMut() -> V + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>
'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)
<template>.Source§fn hydrate<const FROM_SERVER: bool>(
self,
key: &str,
el: &Element,
) -> <F as AttributeValue>::State
fn hydrate<const FROM_SERVER: bool>( self, key: &str, el: &Element, ) -> <F as AttributeValue>::State
<template>.Source§fn build(self, el: &Element, key: &str) -> <F as AttributeValue>::State
fn build(self, el: &Element, key: &str) -> <F as AttributeValue>::State
Source§fn rebuild(self, key: &str, state: &mut <F as AttributeValue>::State)
fn rebuild(self, key: &str, state: &mut <F as AttributeValue>::State)
Source§fn into_cloneable(self) -> <F as AttributeValue>::Cloneable
fn into_cloneable(self) -> <F as AttributeValue>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as AttributeValue>::CloneableOwned
fn into_cloneable_owned(self) -> <F as AttributeValue>::CloneableOwned
'static.Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as AttributeValue>::AsyncOutput
async fn resolve(self) -> <F as AttributeValue>::AsyncOutput
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>>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> ComponentFunction<(), EmptyMarker> for F
impl<F> ComponentFunction<(), EmptyMarker> for F
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>>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>>
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
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.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>
submit event.Source§impl<E, T, Request> FromReq<MultipartFormData, Request, E> for T
impl<E, T, Request> FromReq<MultipartFormData, Request, E> for T
Source§impl<E, T, Request> FromReq<StreamingText, Request, E> for T
impl<E, T, Request> FromReq<StreamingText, Request, E> for T
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
Source§fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<F, V> InnerHtmlValue for Fwhere
F: ReactiveFunction<Output = V>,
V: InnerHtmlValue + 'static,
<V as InnerHtmlValue>::State: 'static,
impl<F, V> InnerHtmlValue for Fwhere
F: ReactiveFunction<Output = V>,
V: InnerHtmlValue + 'static,
<V as InnerHtmlValue>::State: 'static,
Source§type AsyncOutput = <V as InnerHtmlValue>::AsyncOutput
type AsyncOutput = <V as InnerHtmlValue>::AsyncOutput
Source§type State = RenderEffect<<V as InnerHtmlValue>::State>
type State = RenderEffect<<V as InnerHtmlValue>::State>
Source§type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>
'static.Source§fn to_template(_buf: &mut String)
fn to_template(_buf: &mut String)
<template>.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <F as InnerHtmlValue>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as InnerHtmlValue>::State
<template>.Source§fn build(self, el: &Element) -> <F as InnerHtmlValue>::State
fn build(self, el: &Element) -> <F as InnerHtmlValue>::State
Source§fn rebuild(self, state: &mut <F as InnerHtmlValue>::State)
fn rebuild(self, state: &mut <F as InnerHtmlValue>::State)
Source§fn into_cloneable(self) -> <F as InnerHtmlValue>::Cloneable
fn into_cloneable(self) -> <F as InnerHtmlValue>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as InnerHtmlValue>::CloneableOwned
fn into_cloneable_owned(self) -> <F as InnerHtmlValue>::CloneableOwned
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as InnerHtmlValue>::AsyncOutput
async fn resolve(self) -> <F as InnerHtmlValue>::AsyncOutput
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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
Source§impl<F, C> IntoClass for F
impl<F, C> IntoClass for F
Source§type AsyncOutput = <C as IntoClass>::AsyncOutput
type AsyncOutput = <C as IntoClass>::AsyncOutput
Source§type State = RenderEffect<<C as IntoClass>::State>
type State = RenderEffect<<C as IntoClass>::State>
Source§type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <F as IntoClass>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as IntoClass>::State
<template>.Source§fn build(self, el: &Element) -> <F as IntoClass>::State
fn build(self, el: &Element) -> <F as IntoClass>::State
Source§fn into_cloneable(self) -> <F as IntoClass>::Cloneable
fn into_cloneable(self) -> <F as IntoClass>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as IntoClass>::CloneableOwned
fn into_cloneable_owned(self) -> <F as IntoClass>::CloneableOwned
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as IntoClass>::AsyncOutput
async fn resolve(self) -> <F as IntoClass>::AsyncOutput
Source§fn reset(state: &mut <F as IntoClass>::State)
fn reset(state: &mut <F as IntoClass>::State)
Source§const MIN_LENGTH: usize = _
const MIN_LENGTH: usize = _
Source§fn should_overwrite(&self) -> bool
fn should_overwrite(&self) -> bool
true for class="..." attributes, false for class:name=value directives.Source§fn to_template(class: &mut String)
fn to_template(class: &mut String)
<template>.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 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
Source§impl<T, F> IntoOptionGetter<T, FunctionMarker> for F
impl<T, F> IntoOptionGetter<T, FunctionMarker> for F
Source§fn into_option_getter(self) -> OptionGetter<T>
fn into_option_getter(self) -> OptionGetter<T>
OptionGetter.Source§impl<F, V> IntoProperty for Fwhere
F: ReactiveFunction<Output = V>,
V: IntoProperty + 'static,
<V as IntoProperty>::State: 'static,
impl<F, V> IntoProperty for Fwhere
F: ReactiveFunction<Output = V>,
V: IntoProperty + 'static,
<V as IntoProperty>::State: 'static,
Source§type State = RenderEffect<<V as IntoProperty>::State>
type State = RenderEffect<<V as IntoProperty>::State>
Source§type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> V + Send>>
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
key: &str,
) -> <F as IntoProperty>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, key: &str, ) -> <F as IntoProperty>::State
Source§fn build(self, el: &Element, key: &str) -> <F as IntoProperty>::State
fn build(self, el: &Element, key: &str) -> <F as IntoProperty>::State
Source§fn rebuild(self, state: &mut <F as IntoProperty>::State, key: &str)
fn rebuild(self, state: &mut <F as IntoProperty>::State, key: &str)
Source§fn into_cloneable(self) -> <F as IntoProperty>::Cloneable
fn into_cloneable(self) -> <F as IntoProperty>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as IntoProperty>::CloneableOwned
fn into_cloneable_owned(self) -> <F as IntoProperty>::CloneableOwned
Source§impl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for Iwhere
I: Into<T>,
impl<T, I> IntoReactiveValue<T, __IntoReactiveValueMarkerBaseCase> for Iwhere
I: Into<T>,
Source§fn into_reactive_value(self) -> T
fn into_reactive_value(self) -> T
self into a T.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
Source§impl<F, C> IntoStyle for F
impl<F, C> IntoStyle for F
Source§type AsyncOutput = <C as IntoStyle>::AsyncOutput
type AsyncOutput = <C as IntoStyle>::AsyncOutput
Source§type State = RenderEffect<<C as IntoStyle>::State>
type State = RenderEffect<<C as IntoStyle>::State>
Source§type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> C + Send>>
'static.Source§fn hydrate<const FROM_SERVER: bool>(
self,
el: &Element,
) -> <F as IntoStyle>::State
fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <F as IntoStyle>::State
<template>.Source§fn build(self, el: &Element) -> <F as IntoStyle>::State
fn build(self, el: &Element) -> <F as IntoStyle>::State
Source§fn into_cloneable(self) -> <F as IntoStyle>::Cloneable
fn into_cloneable(self) -> <F as IntoStyle>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as IntoStyle>::CloneableOwned
fn into_cloneable_owned(self) -> <F as IntoStyle>::CloneableOwned
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as IntoStyle>::AsyncOutput
async fn resolve(self) -> <F as IntoStyle>::AsyncOutput
Source§impl<F, S> IntoStyleValue for Fwhere
F: ReactiveFunction<Output = S>,
S: IntoStyleValue + 'static,
impl<F, S> IntoStyleValue for Fwhere
F: ReactiveFunction<Output = S>,
S: IntoStyleValue + 'static,
Source§type AsyncOutput = F
type AsyncOutput = F
Source§type State = (Arc<str>, RenderEffect<<S as IntoStyleValue>::State>)
type State = (Arc<str>, RenderEffect<<S as IntoStyleValue>::State>)
Source§type CloneableOwned = Arc<Mutex<dyn FnMut() -> S + Send>>
type CloneableOwned = Arc<Mutex<dyn FnMut() -> S + Send>>
'static.Source§fn build(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <F as IntoStyleValue>::State
fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <F as IntoStyleValue>::State
Source§fn rebuild(
self,
style: &CssStyleDeclaration,
name: &str,
state: &mut <F as IntoStyleValue>::State,
)
fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <F as IntoStyleValue>::State, )
Source§fn hydrate(
self,
style: &CssStyleDeclaration,
name: &str,
) -> <F as IntoStyleValue>::State
fn hydrate( self, style: &CssStyleDeclaration, name: &str, ) -> <F as IntoStyleValue>::State
<template>.Source§fn into_cloneable(self) -> <F as IntoStyleValue>::Cloneable
fn into_cloneable(self) -> <F as IntoStyleValue>::Cloneable
Source§fn into_cloneable_owned(self) -> <F as IntoStyleValue>::CloneableOwned
fn into_cloneable_owned(self) -> <F as IntoStyleValue>::CloneableOwned
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as IntoStyleValue>::AsyncOutput
async fn resolve(self) -> <F as IntoStyleValue>::AsyncOutput
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.Source§impl<F, T> ReactiveFunction for F
impl<F, T> ReactiveFunction for F
Source§impl<T> Read for Twhere
T: Track + ReadUntracked,
impl<T> Read for Twhere
T: Track + ReadUntracked,
Source§impl<F, V> Render for F
impl<F, V> Render for F
Source§impl<F, V> RenderHtml for F
impl<F, V> RenderHtml for F
Source§const MIN_LENGTH: usize = 0
const MIN_LENGTH: usize = 0
Source§type AsyncOutput = <V as RenderHtml>::AsyncOutput
type AsyncOutput = <V as RenderHtml>::AsyncOutput
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
Source§async fn resolve(self) -> <F as RenderHtml>::AsyncOutput
async fn resolve(self) -> <F as RenderHtml>::AsyncOutput
Source§fn html_len(&self) -> usize
fn html_len(&self) -> usize
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>, )
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
F: 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
F: Sized,
Source§fn hydrate<const FROM_SERVER: bool>(
self,
cursor: &Cursor,
position: &PositionState,
) -> <F as Render>::State
fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <F as Render>::State
Source§async fn hydrate_async(
self,
cursor: &Cursor,
position: &PositionState,
) -> <F as Render>::State
async fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> <F as Render>::State
Source§fn into_owned(self) -> <F as RenderHtml>::Owned
fn into_owned(self) -> <F as RenderHtml>::Owned
'static.Source§const EXISTS: bool = true
const EXISTS: bool = true
Source§fn to_html_branching(self) -> Stringwhere
Self: Sized,
fn to_html_branching(self) -> Stringwhere
Self: Sized,
Source§fn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
Source§fn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
Source§fn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
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,
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,
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,
RenderHtml::hydrate, beginning at the given element and position.Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<F, V> ToTemplate for Fwhere
F: ReactiveFunction<Output = V>,
V: ToTemplate,
impl<F, V> ToTemplate for Fwhere
F: ReactiveFunction<Output = V>,
V: ToTemplate,
Source§fn to_template(
buf: &mut String,
class: &mut String,
style: &mut String,
inner_html: &mut String,
position: &mut Position,
)
fn to_template( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )
<template> that corresponds
to a view of a particular type.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
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
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
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>
None if the signal has already been disposed.