Enum leptos::View

source ·
pub enum View {
    Element(Element),
    Text(Text),
    Component(ComponentRepr),
    CoreComponent(CoreComponent),
    Transparent(Transparent),
    Suspense(HydrationKeyCoreComponent),
}
Expand description

A leptos view which can be mounted to the DOM.

Variants§

§

Element(Element)

HTML element node.

§

Text(Text)

HTML text node.

§

Component(ComponentRepr)

Custom leptos component.

§

CoreComponent(CoreComponent)

leptos core-component.

§

Transparent(Transparent)

Wraps arbitrary data that’s not part of the view but is passed via the view tree.

§

Suspense(HydrationKeyCoreComponent)

Marks the contents of Suspense component, which can be replaced in streaming SSR.

Implementations§

Consumes the node and renders it into an HTML string.

Returns Some Text if the view is of this type. None otherwise.

Returns Some Element if the view is of this type. None otherwise.

Returns Some Transparent if the view is of this type. None otherwise.

Returns [Ok(HtmlElement<AnyElement>)] if this View is of type Element. [Err(View)] otherwise.

Adds an event listener, analogous to HtmlElement::on.

This method will attach an event listener to all child HtmlElement children.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

The default View is the Unit core-component.

Returns the “default value” for a type. Read more
Converts to this type from the input type.
Creates a value from an iterator. Read more
Converts the value into View.
Converts the value into View.
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more