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, Css, bool,
numeric types, and Signal<T> (which resolves the signal first).
Required Methods§
Sourcefn into_reactive_string(self) -> String
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.
impl IntoReactiveString for &str
Converts a string slice into an owned string for reactive string storage.
Source§fn into_reactive_string(self) -> String
fn into_reactive_string(self) -> String
Source§impl IntoReactiveString for bool
Converts a bool into "true" or "false" for reactive string storage.
impl IntoReactiveString for bool
Converts a bool into "true" or "false" for reactive string storage.
Source§fn into_reactive_string(self) -> String
fn into_reactive_string(self) -> String
Source§impl IntoReactiveString for f64
Converts a f64 into a string for reactive string storage.
impl IntoReactiveString for f64
Converts a f64 into a string for reactive string storage.
Source§fn into_reactive_string(self) -> String
fn into_reactive_string(self) -> String
Source§impl IntoReactiveString for i32
Converts an i32 into a string for reactive string storage.
impl IntoReactiveString for i32
Converts an i32 into a string for reactive string storage.
Source§fn into_reactive_string(self) -> String
fn into_reactive_string(self) -> String
Source§impl IntoReactiveString for u32
Converts a u32 into a string for reactive string storage.
impl IntoReactiveString for u32
Converts a u32 into a string for reactive string storage.
Source§fn into_reactive_string(self) -> String
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.
impl IntoReactiveString for String
Converts a String into its own value for reactive string storage.
Source§fn into_reactive_string(self) -> String
fn into_reactive_string(self) -> String
Implementors§
impl IntoReactiveString for &'static Css
Converts a reference to a Css into its class name for reactive string storage.
impl IntoReactiveString for Css
Converts a Css into its class name for reactive string storage.
impl IntoReactiveString for Signal<bool>
Converts a bool signal into a reactive string by resolving its current value.
impl IntoReactiveString for Signal<String>
Converts a string signal into a reactive string by resolving its current value.