This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.
yew::functional

Trait FunctionProvider

Source
pub trait FunctionProvider {
    type Properties: Properties + PartialEq;

    // Required method
    fn run(ctx: &mut HookContext, props: &Self::Properties) -> HtmlResult;
}
Expand description

Trait that allows a struct to act as Function Component.

Required Associated Types§

Source

type Properties: Properties + PartialEq

Properties for the Function Component.

Required Methods§

Source

fn run(ctx: &mut HookContext, props: &Self::Properties) -> HtmlResult

Render the component. This function returns the Html to be rendered for the component.

Equivalent of Component::view.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§