Skip to main content

ArcRwSignal

Struct ArcRwSignal 

Source
pub struct ArcRwSignal<T> { /* private fields */ }
Expand description

A reference-counted signal that can be read from or written to.

A signal is a piece of data that may change over time, and notifies other code when it has changed. This is the atomic unit of reactivity, which begins all other processes of reactive updates.

This is a reference-counted signal, which is Clone but not Copy. For arena-allocated Copy signals, use RwSignal.

§Core Trait Implementations

§Reading the Value

  • .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 an async stream of values.

§Updating the Value

  • .set() sets the signal to a new value.
  • .update() updates the value of the signal by applying a closure that takes a mutable reference.
  • .write() returns a guard through which the signal can be mutated, and which notifies subscribers when it is dropped.

Each of these has a related _untracked() method, which updates the signal without notifying subscribers. Untracked updates are not desirable in most cases, as they cause “tearing” between the signal’s value and its observed value. If you want a non-reactive container, used ArenaItem instead.

§Examples

let count = ArcRwSignal::new(0);

// ✅ calling the getter clones and returns the value
//    this can be `count()` on nightly
assert_eq!(count.get(), 0);

// ✅ calling the setter sets the value
//    this can be `set_count(1)` on nightly
count.set(1);
assert_eq!(count.get(), 1);

// ❌ you could call the getter within the setter
// set_count.set(count.get() + 1);

// ✅ however it's more efficient to use .update() and mutate the value in place
count.update(|count: &mut i32| *count += 1);
assert_eq!(count.get(), 2);

// ✅ you can create "derived signals" with a Fn() -> T interface
let double_count = {
  // clone before moving into the closure because we use it below
  let count = count.clone();
  move || count.get() * 2
};
count.set(0);
assert_eq!(double_count(), 0);
count.set(1);
assert_eq!(double_count(), 2);

Implementations§

Source§

impl<T> ArcRwSignal<T>

Source

pub fn new(value: T) -> ArcRwSignal<T>

Creates a new signal, taking the initial value as its argument.

Source

pub fn read_only(&self) -> ArcReadSignal<T>

Returns a read-only handle to the signal.

Source

pub fn write_only(&self) -> ArcWriteSignal<T>

Returns a write-only handle to the signal.

Source

pub fn split(&self) -> (ArcReadSignal<T>, ArcWriteSignal<T>)

Splits the signal into its readable and writable halves.

Source

pub fn unite( read: ArcReadSignal<T>, write: ArcWriteSignal<T>, ) -> Option<ArcRwSignal<T>>

Reunites the two halves of a signal. Returns None if the two signals provided were not created from the same signal.

Trait Implementations§

Source§

impl<V> AddAnyAttr for ArcRwSignal<V>
where V: RenderHtml + Clone + Send + Sync + 'static, <V as Render>::State: 'static, ArcRwSignal<V>: Get<Value = V>,

Source§

type Output<SomeNewAttr: Attribute> = ArcRwSignal<V>

The new type once the attribute has been added.
Source§

fn add_any_attr<NewAttr>( self, _attr: NewAttr, ) -> <ArcRwSignal<V> as AddAnyAttr>::Output<NewAttr>
where NewAttr: Attribute,

Adds an attribute to the view.
Source§

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

Source§

type AsyncOutput = ArcRwSignal<V>

The type once all async data have loaded.
Source§

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

The state that should be retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

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 = ArcRwSignal<V>

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 html_len(&self) -> usize

An approximation of the actual length of this attribute in HTML.
Source§

fn to_html(self, key: &str, buf: &mut String)

Renders the attribute value to HTML.
Source§

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, ) -> <ArcRwSignal<V> 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, ) -> <ArcRwSignal<V> as AttributeValue>::State

Adds this attribute to the element during client-side rendering.
Source§

fn rebuild( self, key: &str, state: &mut <ArcRwSignal<V> as AttributeValue>::State, )

Applies a new value for the attribute.
Source§

fn into_cloneable(self) -> <ArcRwSignal<V> as AttributeValue>::Cloneable

Converts this attribute into an equivalent that can be cloned.
Source§

fn into_cloneable_owned( self, ) -> <ArcRwSignal<V> as AttributeValue>::CloneableOwned

Converts this attributes into an equivalent that can be cloned and is 'static.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <ArcRwSignal<V> as AttributeValue>::AsyncOutput

“Resolves” this into a form that is not waiting for any asynchronous data.
Source§

impl<T> Clone for ArcRwSignal<T>

Source§

fn clone(&self) -> ArcRwSignal<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for ArcRwSignal<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for ArcRwSignal<T>
where T: Default,

Source§

fn default() -> ArcRwSignal<T>

Returns the “default value” for a type. Read more
Source§

impl<T> DefinedAt for ArcRwSignal<T>

Source§

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> Deserialize<'de> for ArcRwSignal<T>
where T: Deserialize<'de>,

Source§

fn deserialize<D>( deserializer: D, ) -> Result<ArcRwSignal<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a, T> From<&'a ArcRwSignal<T>> for RwSignal<T>
where T: Send + Sync + 'static,

Source§

fn from(value: &'a ArcRwSignal<T>) -> RwSignal<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for ArcMemo<T>
where T: Clone + PartialEq + Send + Sync + 'static,

Source§

fn from(value: ArcRwSignal<T>) -> ArcMemo<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for ArcSignal<T>
where T: Send + Sync,

Source§

fn from(value: ArcRwSignal<T>) -> ArcSignal<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for MaybeSignal<T>
where T: Send + Sync + 'static,

Source§

fn from(value: ArcRwSignal<T>) -> MaybeSignal<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for RwSignal<T>
where T: Send + Sync + 'static,

Source§

fn from(value: ArcRwSignal<T>) -> RwSignal<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for Signal<T>
where T: Send + Sync + 'static,

Source§

fn from(value: ArcRwSignal<T>) -> Signal<T>

Converts to this type from the input type.
Source§

impl<T> From<ArcRwSignal<T>> for Signal<T, LocalStorage>
where T: Send + Sync + 'static,

Source§

fn from(value: ArcRwSignal<T>) -> Signal<T, LocalStorage>

Converts to this type from the input type.
Source§

impl<V> From<ArcRwSignal<V>> for TextProp
where V: Into<Oco<'static, str>> + Clone + Send + Sync + 'static, ArcRwSignal<V>: Get<Value = V>,

Source§

fn from(s: ArcRwSignal<V>) -> TextProp

Converts to this type from the input type.
Source§

impl<T, S> From<RwSignal<T, S>> for ArcRwSignal<T>
where T: 'static, S: Storage<ArcRwSignal<T>>,

Source§

fn from(value: RwSignal<T, S>) -> ArcRwSignal<T>

Converts to this type from the input type.
Source§

impl<T> FromLocal<ArcRwSignal<T>> for MaybeSignal<T, LocalStorage>
where T: 'static,

Source§

fn from_local(value: ArcRwSignal<T>) -> MaybeSignal<T, LocalStorage>

Converts between the types.
Source§

impl<T> FromLocal<ArcRwSignal<T>> for RwSignal<T, LocalStorage>
where T: 'static,

Source§

fn from_local(value: ArcRwSignal<T>) -> RwSignal<T, LocalStorage>

Converts between the types.
Source§

impl<T> Hash for ArcRwSignal<T>

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

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

Source§

type AsyncOutput = ArcRwSignal<V>

The type after all async data have resolved.
Source§

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

The view state retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

An equivalent value that can be cloned.
Source§

type CloneableOwned = ArcRwSignal<V>

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

fn html_len(&self) -> usize

The estimated length of the HTML.
Source§

fn to_html(self, buf: &mut String)

Renders the class to HTML.
Source§

fn to_template(_buf: &mut String)

Renders the class to HTML for a <template>.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ArcRwSignal<V> 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) -> <ArcRwSignal<V> as InnerHtmlValue>::State

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

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

Updates the value.
Source§

fn into_cloneable(self) -> <ArcRwSignal<V> as InnerHtmlValue>::Cloneable

Converts this to a cloneable type.
Source§

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

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <ArcRwSignal<V> as InnerHtmlValue>::AsyncOutput

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

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

Source§

type AsyncOutput = ArcRwSignal<V>

The type after all async data have resolved.
Source§

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

The view state retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

An equivalent value that can be cloned.
Source§

type CloneableOwned = ArcRwSignal<V>

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

fn html_len(&self) -> usize

The estimated length of the HTML.
Source§

fn to_html(self, class: &mut String)

Renders the class to HTML.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ArcRwSignal<V> 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) -> <ArcRwSignal<V> as IntoClass>::State

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

fn rebuild(self, state: &mut <ArcRwSignal<V> as IntoClass>::State)

Updates the value.
Source§

fn into_cloneable(self) -> <ArcRwSignal<V> as IntoClass>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <ArcRwSignal<V> as IntoClass>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <ArcRwSignal<V> as IntoClass>::AsyncOutput

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

fn reset(state: &mut <ArcRwSignal<V> as IntoClass>::State)

Reset the class list to the state before this class was added.
Source§

const TEMPLATE: &'static str = ""

The HTML that should be included in a <template>.
Source§

const MIN_LENGTH: usize = _

The minimum length of the HTML.
Source§

fn to_template(class: &mut String)

Renders the class to HTML for a <template>.
Source§

impl<T> IntoInner for ArcRwSignal<T>

Source§

type Value = T

The type of the value contained in the signal.
Source§

fn into_inner(self) -> Option<<ArcRwSignal<T> as IntoInner>::Value>

Returns the inner value if this is the only reference to the signal. Otherwise, returns None and drops this reference. Read more
Source§

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

Source§

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

The view state retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

An equivalent value that can be cloned.
Source§

type CloneableOwned = ArcRwSignal<V>

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

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, key: &str, ) -> <ArcRwSignal<V> as IntoProperty>::State

Adds the property on an element created from HTML.
Source§

fn build( self, el: &Element, key: &str, ) -> <ArcRwSignal<V> as IntoProperty>::State

Adds the property during client-side rendering.
Source§

fn rebuild(self, state: &mut <ArcRwSignal<V> as IntoProperty>::State, key: &str)

Updates the property with a new value.
Source§

fn into_cloneable(self) -> <ArcRwSignal<V> as IntoProperty>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned( self, ) -> <ArcRwSignal<V> as IntoProperty>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

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

Source§

type AsyncOutput = ArcRwSignal<V>

The type after all async data have resolved.
Source§

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

The view state retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

An equivalent value that can be cloned.
Source§

type CloneableOwned = ArcRwSignal<V>

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

fn to_html(self, style: &mut String)

Renders the style to HTML.
Source§

fn hydrate<const FROM_SERVER: bool>( self, el: &Element, ) -> <ArcRwSignal<V> 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) -> <ArcRwSignal<V> as IntoStyle>::State

Adds this style to the element during client-side rendering.
Source§

fn rebuild(self, state: &mut <ArcRwSignal<V> as IntoStyle>::State)

Updates the value.
Source§

fn into_cloneable(self) -> <ArcRwSignal<V> as IntoStyle>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned(self) -> <ArcRwSignal<V> as IntoStyle>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <ArcRwSignal<V> as IntoStyle>::AsyncOutput

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

fn reset(state: &mut <ArcRwSignal<V> as IntoStyle>::State)

Reset the styling to the state before this style was added.
Source§

impl<V> IntoStyleValue for ArcRwSignal<V>
where V: IntoStyleValue + Send + Sync + Clone + 'static, ArcRwSignal<V>: Get<Value = V>,

Source§

type AsyncOutput = ArcRwSignal<V>

The type after all async data have resolved.
Source§

type State = (Arc<str>, RenderEffect<<V as IntoStyleValue>::State>)

The view state retained between building and rebuilding.
Source§

type Cloneable = ArcRwSignal<V>

An equivalent value that can be cloned.
Source§

type CloneableOwned = ArcRwSignal<V>

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

fn to_html(self, name: &str, style: &mut String)

Renders the style to HTML.
Source§

fn build( self, style: &CssStyleDeclaration, name: &str, ) -> <ArcRwSignal<V> as IntoStyleValue>::State

Adds this style to the element during client-side rendering.
Source§

fn rebuild( self, style: &CssStyleDeclaration, name: &str, state: &mut <ArcRwSignal<V> as IntoStyleValue>::State, )

Updates the value.
Source§

fn hydrate( self, style: &CssStyleDeclaration, name: &str, ) -> <ArcRwSignal<V> 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) -> <ArcRwSignal<V> as IntoStyleValue>::Cloneable

Converts this to a cloneable type.
Source§

fn into_cloneable_owned( self, ) -> <ArcRwSignal<V> as IntoStyleValue>::CloneableOwned

Converts this to a cloneable, owned type.
Source§

fn dry_resolve(&mut self)

“Runs” the attribute without other side effects. For primitive types, this is a no-op. For reactive types, this can be used to gather data about reactivity or about asynchronous data that needs to be loaded.
Source§

async fn resolve(self) -> <ArcRwSignal<V> as IntoStyleValue>::AsyncOutput

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

impl<T> IsDisposed for ArcRwSignal<T>

Source§

fn is_disposed(&self) -> bool

If true, the signal cannot be accessed without a panic.
Source§

impl<T> Notify for ArcRwSignal<T>

Source§

fn notify(&self)

Notifies subscribers of a change in this signal.
Source§

impl<T> PartialEq for ArcRwSignal<T>

Source§

fn eq(&self, other: &ArcRwSignal<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> ReadUntracked for ArcRwSignal<T>
where T: 'static,

Source§

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<<ArcRwSignal<T> as ReadUntracked>::Value>

Returns the guard, or None if the signal has already been disposed.
Source§

fn read_untracked(&self) -> Self::Value

Returns the guard. Read more
Source§

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 more
Source§

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

Source§

type State = RenderEffectState<<V as Render>::State>

The “view state” for this type, which can be retained between updates. Read more
Source§

fn build(self) -> <ArcRwSignal<V> as Render>::State

Creates the view for the first time, without hydrating from existing HTML.
Source§

fn rebuild(self, state: &mut <ArcRwSignal<V> as Render>::State)

Updates the view with new data.
Source§

impl<V> RenderHtml for ArcRwSignal<V>
where V: RenderHtml + Clone + Send + Sync + 'static, <V as Render>::State: 'static, ArcRwSignal<V>: Get<Value = V>,

Source§

const MIN_LENGTH: usize = 0

The minimum length of HTML created when this view is rendered.
Source§

type AsyncOutput = ArcRwSignal<V>

The type of the view after waiting for all asynchronous data to load.
Source§

type Owned = ArcRwSignal<V>

An equivalent value that is 'static.
Source§

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) -> <ArcRwSignal<V> as RenderHtml>::AsyncOutput

Waits for any asynchronous sections of the view to load and returns the output.
Source§

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>, )

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 ArcRwSignal<V>: 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, ) -> <ArcRwSignal<V> as Render>::State

Makes a set of DOM nodes rendered from HTML interactive. Read more
Source§

fn into_owned(self) -> <ArcRwSignal<V> as RenderHtml>::Owned

Convert into the equivalent value that is 'static.
Source§

const EXISTS: bool = true

Whether this should actually exist in the DOM, if it is the child of an element.
Source§

fn to_html(self) -> String
where Self: Sized,

Renders a view to an HTML string.
Source§

fn to_html_branching(self) -> String
where 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) -> StreamBuilder
where Self: Sized,

Renders a view to an in-order stream of HTML.
Source§

fn to_html_stream_in_order_branching(self) -> StreamBuilder
where 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) -> StreamBuilder
where Self: Sized,

Renders a view to an out-of-order stream of HTML.
Source§

fn to_html_stream_out_of_order_branching(self) -> StreamBuilder
where 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>

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::State
where 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::State
where Self: Sized,

Hydrates using RenderHtml::hydrate, beginning at the given element and position.
Source§

impl<T> Serialize for ArcRwSignal<T>
where T: Serialize + 'static,

Source§

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> Write for ArcRwSignal<T>
where T: 'static,

Source§

type Value = T

The type of the signal’s value.
Source§

fn try_write(&self) -> Option<impl UntrackableGuard>

Returns the guard, or None if the signal has already been disposed.
Source§

fn try_write_untracked( &self, ) -> Option<UntrackedWriteGuard<<ArcRwSignal<T> as Write>::Value>>

or None if the signal has already been disposed.
Source§

fn write(&self) -> impl UntrackableGuard

Returns the guard. Read more
Source§

fn write_untracked(&self) -> impl DerefMut

Returns a guard that will not notify subscribers when dropped. Read more
Source§

impl<T> Eq for ArcRwSignal<T>

Auto Trait Implementations§

§

impl<T> Freeze for ArcRwSignal<T>

§

impl<T> RefUnwindSafe for ArcRwSignal<T>

§

impl<T> Send for ArcRwSignal<T>
where T: Send + Sync,

§

impl<T> Sync for ArcRwSignal<T>
where T: Send + Sync,

§

impl<T> Unpin for ArcRwSignal<T>

§

impl<T> UnwindSafe for ArcRwSignal<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for V
where 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>>

The type of the element with the two-way binding added.
Source§

fn bind( self, key: Key, signal: Sig, ) -> <V as BindAttribute<Key, Sig, T>>::Output

Adds a two-way binding to the element, which adds an attribute and an event listener to the element when the element is created or hydrated. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T, K, V> CustomAttribute<K, V> for T

Source§

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
where V: AddAnyAttr, D: IntoDirective<T, P>, P: Clone + 'static, T: 'static,

Source§

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

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromFormData for T

Source§

fn from_event(ev: &Event) -> Result<T, FromFormDataError>

Tries to deserialize the data, given only the submit event.
Source§

fn from_form_data(form_data: &FormData) -> Result<T, Error>

Tries to deserialize the data, given the actual form data.
Source§

impl<E, T, Request> FromReq<DeleteUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<GetUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<PatchUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<PostUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, T, Request> FromReq<PutUrl, Request, E> for T
where Request: Req<E> + Send + 'static, T: DeserializeOwned, E: FromServerFnError,

Source§

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
Source§

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

Source§

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAny for T
where T: Send + RenderHtml,

Source§

fn into_any(self) -> AnyView

Converts the view into a type-erased AnyView.
Source§

impl<T> IntoAttributeValue for T
where T: AttributeValue,

Source§

type Output = T

The attribute value into which this type can be converted.
Source§

fn into_attribute_value(self) -> <T as IntoAttributeValue>::Output

Consumes this value, transforming it into an attribute value.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> IntoMaybeErased for T
where T: RenderHtml,

Source§

type Output = T

The type of the output.
Source§

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
where S: Get<Value = Option<T>> + Clone + Send + Sync + 'static,

Source§

fn into_option_getter(self) -> OptionGetter<T>

Converts the given value into an OptionGetter.
Source§

impl<T> IntoRender for T
where T: Render,

Source§

type Output = T

The renderable type into which this type can be converted.
Source§

fn into_render(self) -> <T as IntoRender>::Output

Consumes this value, transforming it into the renderable type.
Source§

impl<E, T, Request> IntoReq<DeleteUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Request> IntoReq<GetUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Request> IntoReq<PatchUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Request> IntoReq<PostUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, T, Request> IntoReq<PutUrl, Request, E> for T
where Request: ClientReq<E>, T: Serialize + Send, E: FromServerFnError,

Source§

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
Source§

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

Source§

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Source§

impl<T> IntoView for T
where T: Render + RenderHtml + Send,

Source§

fn into_view(self) -> View<T>

Wraps the inner type.
Source§

impl<T> ReactiveNode for T
where T: AsSubscriberSet + DefinedAt,

Source§

fn mark_dirty(&self)

Notifies the source’s dependencies that it has changed.
Source§

fn mark_check(&self)

Notifies the source’s dependencies that it may have changed.
Source§

fn mark_subscribers_check(&self)

Marks that all subscribers need to be checked.
Source§

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 T
where T: Track + ReadUntracked,

Source§

type Value = <T as ReadUntracked>::Value

The guard type that will be returned, which can be dereferenced to the value.
Source§

fn try_read(&self) -> Option<<T as Read>::Value>

Subscribes to the signal, and returns the guard, or None if the signal has already been disposed.
Source§

fn read(&self) -> Self::Value

Subscribes to the signal, and returns the guard. Read more
Source§

impl<T> SerializableKey for T

Source§

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
Source§

impl<T> Set for T
where T: Update + IsDisposed,

Source§

type Value = <T as Update>::Value

The type of the value contained in the signal.
Source§

fn set(&self, value: <T as Set>::Value)

Updates the value by replacing it, and notifies subscribers that it has changed.
Source§

fn try_set(&self, value: <T as Set>::Value) -> Option<<T as Set>::Value>

Updates the value by replacing it, and notifies subscribers that it has changed. Read more
Source§

impl<T> Source for T
where T: AsSubscriberSet + DefinedAt,

Source§

fn clear_subscribers(&self)

Remove all subscribers from this source’s list of dependencies.
Source§

fn add_subscriber(&self, subscriber: AnySubscriber)

Adds a subscriber to this source’s list of dependencies.
Source§

fn remove_subscriber(&self, subscriber: &AnySubscriber)

Removes a subscriber from this source’s list of dependencies.
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> Track for T

Source§

fn track(&self)

Subscribes to this signal in the current reactive scope without doing anything with its value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Update for T
where T: Write,

Source§

type Value = <T as Write>::Value

The type of the value contained in the signal.
Source§

fn try_maybe_update<U>( &self, fun: impl FnOnce(&mut <T as Update>::Value) -> (bool, U), ) -> Option<U>

Updates the value of the signal, notifying subscribers if the update function returns (true, _), and returns the value returned by the update function, or None if the signal has already been disposed.
Source§

fn update(&self, fun: impl FnOnce(&mut Self::Value))

Updates the value of the signal and notifies subscribers.
Source§

fn maybe_update(&self, fun: impl FnOnce(&mut Self::Value) -> bool)

Updates the value of the signal, but only notifies subscribers if the function returns true.
Source§

fn try_update<U>(&self, fun: impl FnOnce(&mut Self::Value) -> U) -> Option<U>

Updates the value of the signal and notifies subscribers, returning the value that is returned by the update function, or None if the signal has already been disposed.
Source§

impl<T> UpdateUntracked for T
where T: Write,

Source§

type Value = <T as Write>::Value

The type of the value contained in the signal.
Source§

fn try_update_untracked<U>( &self, fun: impl FnOnce(&mut <T as UpdateUntracked>::Value) -> U, ) -> Option<U>

Updates the value by applying a function, returning the value returned by that function, or None if the signal has already been disposed. Does not notify subscribers that the signal has changed.
Source§

fn update_untracked<U>(&self, fun: impl FnOnce(&mut Self::Value) -> U) -> U

Updates the value by applying a function, returning the value returned by that function. Does not notify subscribers that the signal has changed. Read more
Source§

impl<T> With for T
where T: Read,

Source§

type Value = <<T as Read>::Value as Deref>::Target

The type of the value contained in the signal.
Source§

fn try_with<U>(&self, fun: impl FnOnce(&<T as With>::Value) -> U) -> Option<U>

Subscribes to the signal, applies the closure to the value, and returns the result, or None if the signal has already been disposed.
Source§

fn with<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U

Subscribes to the signal, applies the closure to the value, and returns the result. Read more
Source§

impl<T> WithUntracked for T

Source§

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>

Applies the closure to the value, and returns the result, or None if the signal has already been disposed.
Source§

fn with_untracked<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U

Applies the closure to the value, and returns the result. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,