Enum SsrNode

Source
pub enum SsrNode {
    Element {
        tag: Cow<'static, str>,
        attributes: Vec<(Cow<'static, str>, Cow<'static, str>)>,
        bool_attributes: Vec<(Cow<'static, str>, bool)>,
        children: Vec<Self>,
        inner_html: Option<Box<Cow<'static, str>>>,
        hk_key: Option<HydrationKey>,
    },
    TextDynamic {
        text: Cow<'static, str>,
    },
    TextStatic {
        text: Cow<'static, str>,
    },
    Marker,
    Dynamic {
        view: Arc<Mutex<View<Self>>>,
    },
    SuspenseMarker {
        key: u32,
    },
}

Variants§

§

Element

Fields

§tag: Cow<'static, str>
§attributes: Vec<(Cow<'static, str>, Cow<'static, str>)>
§bool_attributes: Vec<(Cow<'static, str>, bool)>
§children: Vec<Self>
§inner_html: Option<Box<Cow<'static, str>>>
§

TextDynamic

Fields

§text: Cow<'static, str>
§

TextStatic

Fields

§text: Cow<'static, str>
§

Marker

§

Dynamic

SSR by default does not update to any dynamic changes in the view. This special node allows dynamically changing the view tree before it is rendered.

This is used for updating the view with suspense content once it is resolved.

Fields

§view: Arc<Mutex<View<Self>>>
§

SuspenseMarker

Fields

§key: u32

Trait Implementations§

Source§

impl From<SsrNode> for View<SsrNode>

Source§

fn from(node: SsrNode) -> Self

Converts to this type from the input type.
Source§

impl ViewHtmlNode for SsrNode

Source§

fn create_element(tag: Cow<'static, str>) -> Self

Create a new HTML element.
Source§

fn create_element_ns(_namespace: &str, tag: Cow<'static, str>) -> Self

Create a new HTML element with a XML namespace.
Source§

fn create_text_node(text: Cow<'static, str>) -> Self

Create a new HTML text node.
Source§

fn create_dynamic_text_node(text: Cow<'static, str>) -> Self

Create a new HTML text node whose value will be changed dynamically.
Source§

fn create_marker_node() -> Self

Create a new HTML marker (comment) node.
Source§

fn set_attribute(&mut self, name: Cow<'static, str>, value: StringAttribute)

Set an HTML attribute.
Source§

fn set_bool_attribute(&mut self, name: Cow<'static, str>, value: BoolAttribute)

Set a boolean HTML attribute.
Source§

fn set_property(&mut self, _name: Cow<'static, str>, _value: MaybeDyn<JsValue>)

Set a JS property on an element.
Source§

fn set_event_handler( &mut self, _name: Cow<'static, str>, _handler: impl FnMut(Event) + 'static, )

Set an event handler on an element.
Source§

fn set_inner_html(&mut self, inner_html: Cow<'static, str>)

Set the inner HTML value of an element.
Source§

fn as_web_sys(&self) -> &Node

Return the raw web-sys node.
Source§

fn from_web_sys(_node: Node) -> Self

Wrap a raw web-sys node.
Source§

impl ViewNode for SsrNode

Source§

fn append_child(&mut self, child: Self)

Appends a child to the node. Panics if the node is not an element or other node that can have children (e.g. text node).
Source§

fn create_dynamic_view<U: Into<View<Self>> + 'static>( f: impl FnMut() -> U + 'static, ) -> View<Self>

Create a dynamic view from a function that returns a view. Read more
Source§

fn append_view(&mut self, view: View<Self>)

Append a view to this node. Since a view is just a list of nodes, this essentially appends every node in the view to this node.

Auto Trait Implementations§

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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