Module rsx

Source
Expand description

The main html module which defines components, listeners, and class helpers.

Structs§

AnyScope
Untyped scope used for accessing parent scope
AssertAllProps
Dummy struct targeted by assertions that all props were set
ChildrenProps
A Properties type with Children being the only property.
ChildrenRenderer
A type used for rendering children html.
Classes
A set of classes, cheap to clone.
Context
The Component’s context. This contains component’s Scope and props and is passed to every lifecycle method.
NodeRef
Wrapped Node reference for later use in Component lifecycle methods.
PhantomComponent
A Component to represent a component that does not exist in current implementation.
Scope
A context which allows sending messages to a component.

Enums§

RenderError
Render Error.

Traits§

AllPropsFor
Trait to specify the requirement for Self to be a valid token signaling all props have been provided to the builder.
BaseComponent
The common base of both function components and struct components.
Buildable
Trait finishing the builder and verifying all props were set. The structure can be a bit surprising, and is related to how the proc macro reports errors
Component
Components are the basic building blocks of the UI in a Yew app. Each Component chooses how to display itself using received props and self-managed state. Components can be dynamic and interactive by declaring messages that are triggered and handled asynchronously. This async update mechanism is inspired by Elm and the actor model used in the Actix framework.
HasAllProps
A marker trait to ensure that the builder has received all required props. For each struct deriving Properties, an impl is generated, requiring HasProp<p> for all properties marked as required as a bound on the impl.
HasProp
A marker trait to ensure that the builder has received a specific required prop. For each required impl in a property, we generate:
ImplicitClone
Marker trait for cheap-to-clone types that should be allowed to be cloned implicitly.
IntoEventCallback
A trait similar to Into<T> which allows conversion of a value into a Callback. This is used for event listeners.
IntoHtmlResult
A trait to translate into a HtmlResult.
IntoPropValue
A trait similar to Into<T> which allows conversion to a value of a Properties struct.
Properties
Trait for building properties for a component
SendAsMessage
Defines a message type that can be sent to a component. Used for the return value of closure given to Scope::batch_callback.
TargetCast
A trait to obtain a generic event target.
ToHtml
A trait implemented for types be rendered as a part of a Html.

Functions§

create_portal
Render children into a DOM node that exists outside the hierarchy of the parent component.

Type Aliases§

Children
A type used for accepting children elements in Component::Properties.
ChildrenWithProps
A type used for accepting children elements in Component::Properties and accessing their props.
Html
A type which expected as a result of view function implementation.
HtmlResult
An enhanced type of Html returned in suspendible function components.
RenderResult
Render Result.

Derive Macros§

ImplicitClone
Properties