Skip to main content

IntoReactiveString

Trait IntoReactiveString 

Source
pub trait IntoReactiveString {
    // Required method
    fn into_reactive_string(self) -> String;
}
Expand description

Trait for converting a value into a string for reactive attribute updates.

Used by the html! macro when an attribute value contains an if condition. The result is stored in a Signal<String> that re-evaluates whenever any signal changes — mirroring the DOM-level DynamicNode mechanism.

Implementations are provided for String, &str, CssClass, bool, numeric types, and Signal<T> (which resolves the signal first).

Required Methods§

Source

fn into_reactive_string(self) -> String

Converts this value into its string representation for attribute storage.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoReactiveString for &str

Converts a string slice into an owned string for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Converts this string slice into an owned String.

§Returns
  • String - The owned string.
Source§

impl IntoReactiveString for bool

Converts a bool into "true" or "false" for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Returns "true" or "false" as a string.

§Returns
  • String - The boolean as a string.
Source§

impl IntoReactiveString for f64

Converts a f64 into a string for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Converts this float into its string representation.

§Returns
  • String - The float as a string.
Source§

impl IntoReactiveString for i32

Converts an i32 into a string for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Converts this integer into its string representation.

§Returns
  • String - The integer as a string.
Source§

impl IntoReactiveString for u32

Converts a u32 into a string for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Converts this unsigned integer into its string representation.

§Returns
  • String - The unsigned integer as a string.
Source§

impl IntoReactiveString for String

Converts a String into its own value for reactive string storage.

Source§

fn into_reactive_string(self) -> String

Returns this string as-is.

§Returns
  • String - The same string.

Implementors§

Source§

impl IntoReactiveString for &'static CssClass

Converts a reference to a CssClass into its class name for reactive string storage.

Source§

impl IntoReactiveString for CssClass

Converts a CssClass into its class name for reactive string storage.

Source§

impl IntoReactiveString for Signal<bool>

Converts a bool signal into a reactive string by resolving its current value.

Source§

impl IntoReactiveString for Signal<String>

Converts a string signal into a reactive string by resolving its current value.