Enum SsrNode
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<SsrNode>,
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>>,
},
SuspenseMarker {
key: u32,
},
}
Variants§
Element
Fields
§
hk_key: Option<HydrationKey>
TextDynamic
TextStatic
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.
SuspenseMarker
Trait Implementations§
§impl ViewHtmlNode for SsrNode
impl ViewHtmlNode for SsrNode
§fn create_element(tag: Cow<'static, str>) -> SsrNode
fn create_element(tag: Cow<'static, str>) -> SsrNode
Create a new HTML element.
§fn create_element_ns(_namespace: &str, tag: Cow<'static, str>) -> SsrNode
fn create_element_ns(_namespace: &str, tag: Cow<'static, str>) -> SsrNode
Create a new HTML element with a XML namespace.
§fn create_text_node(text: Cow<'static, str>) -> SsrNode
fn create_text_node(text: Cow<'static, str>) -> SsrNode
Create a new HTML text node.
§fn create_dynamic_text_node(text: Cow<'static, str>) -> SsrNode
fn create_dynamic_text_node(text: Cow<'static, str>) -> SsrNode
Create a new HTML text node whose value will be changed dynamically.
§fn create_marker_node() -> SsrNode
fn create_marker_node() -> SsrNode
Create a new HTML marker (comment) node.
§fn set_attribute(
&mut self,
name: Cow<'static, str>,
value: MaybeDyn<Option<Cow<'static, str>>>,
)
fn set_attribute( &mut self, name: Cow<'static, str>, value: MaybeDyn<Option<Cow<'static, str>>>, )
Set an HTML attribute.
§fn set_bool_attribute(&mut self, name: Cow<'static, str>, value: MaybeDyn<bool>)
fn set_bool_attribute(&mut self, name: Cow<'static, str>, value: MaybeDyn<bool>)
Set a boolean HTML attribute.
§fn set_property(&mut self, _name: Cow<'static, str>, _value: MaybeDyn<JsValue>)
fn set_property(&mut self, _name: Cow<'static, str>, _value: MaybeDyn<JsValue>)
Set a JS property on an element.
§fn set_event_handler(
&mut self,
_name: Cow<'static, str>,
_handler: impl FnMut(Event) + 'static,
)
fn set_event_handler( &mut self, _name: Cow<'static, str>, _handler: impl FnMut(Event) + 'static, )
Set an event handler on an element.
§fn set_inner_html(&mut self, inner_html: Cow<'static, str>)
fn set_inner_html(&mut self, inner_html: Cow<'static, str>)
Set the inner HTML value of an element.
§fn as_web_sys(&self) -> &Node
fn as_web_sys(&self) -> &Node
Return the raw web-sys node.
§fn from_web_sys(_node: Node) -> SsrNode
fn from_web_sys(_node: Node) -> SsrNode
Wrap a raw web-sys node.
§impl ViewNode for SsrNode
impl ViewNode for SsrNode
§fn append_child(&mut self, child: SsrNode)
fn append_child(&mut self, child: SsrNode)
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).
§fn create_dynamic_view<U>(f: impl FnMut() -> U + 'static) -> View
fn create_dynamic_view<U>(f: impl FnMut() -> U + 'static) -> View
Create a dynamic view from a function that returns a view. Read more
§fn append_view(&mut self, view: View<Self>)
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§
impl Freeze for SsrNode
impl RefUnwindSafe for SsrNode
impl Send for SsrNode
impl Sync for SsrNode
impl Unpin for SsrNode
impl UnwindSafe for SsrNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more