use crate::*;
impl IntoReactiveValue for String {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Text(self)
}
}
impl IntoReactiveValue for &str {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Text(self.to_string())
}
}
impl IntoReactiveValue for Signal<String> {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Signal(self)
}
}
impl IntoReactiveValue for Signal<bool> {
fn into_reactive_value(self) -> AttributeValue {
bool_signal_to_string_attribute_value(self)
}
}
impl IntoReactiveValue for bool {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Dynamic(self.to_string())
}
}
impl IntoReactiveValue for i32 {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Dynamic(self.to_string())
}
}
impl IntoReactiveValue for f64 {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Dynamic(self.to_string())
}
}
impl IntoReactiveValue for CssClass {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Css(self)
}
}
impl IntoReactiveValue for &'static CssClass {
fn into_reactive_value(self) -> AttributeValue {
AttributeValue::Css(self.clone())
}
}
impl IntoReactiveString for String {
fn into_reactive_string(self) -> String {
self
}
}
impl IntoReactiveString for &str {
fn into_reactive_string(self) -> String {
self.to_string()
}
}
impl IntoReactiveString for CssClass {
fn into_reactive_string(self) -> String {
self.get_name().to_string()
}
}
impl IntoReactiveString for &'static CssClass {
fn into_reactive_string(self) -> String {
self.get_name().to_string()
}
}
impl IntoReactiveString for bool {
fn into_reactive_string(self) -> String {
self.to_string()
}
}
impl IntoReactiveString for i32 {
fn into_reactive_string(self) -> String {
self.to_string()
}
}
impl IntoReactiveString for u32 {
fn into_reactive_string(self) -> String {
self.to_string()
}
}
impl IntoReactiveString for f64 {
fn into_reactive_string(self) -> String {
self.to_string()
}
}
impl IntoReactiveString for Signal<String> {
fn into_reactive_string(self) -> String {
self.get()
}
}
impl IntoReactiveString for Signal<bool> {
fn into_reactive_string(self) -> String {
self.get().to_string()
}
}
impl<F> IntoCallbackAttribute for F
where
F: FnMut(NativeEvent) + 'static,
{
fn into_callback_attribute(self) -> AttributeValue {
AttributeValue::Event(NativeEventHandler::new(
NativeEventName::Other("callback".to_string()),
self,
))
}
}
impl IntoCallbackAttribute for NativeEventHandler {
fn into_callback_attribute(self) -> AttributeValue {
AttrValueAdapter::new(self).into_callback_attribute_value()
}
}
impl IntoCallbackAttribute for Option<NativeEventHandler> {
fn into_callback_attribute(self) -> AttributeValue {
AttrValueAdapter::new(self).into_callback_attribute_value()
}
}