Trait FunctionProvider

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

    // Required method
    fn run(
        ctx: &mut HookContext,
        props: &Self::Properties,
    ) -> Result<VNode, RenderError>;
}
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, ) -> Result<VNode, RenderError>

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.

Implementations on Foreign Typesยง

Sourceยง

impl FunctionProvider for Global

Sourceยง

impl FunctionProvider for ManagerProvider

Sourceยง

impl FunctionProvider for BrowserRouter

Sourceยง

impl FunctionProvider for HashRouter

Sourceยง

impl FunctionProvider for Router

Sourceยง

impl<R> FunctionProvider for Redirect<R>
where R: Routable + 'static,

Sourceยง

impl<R> FunctionProvider for Switch<R>
where R: Routable + 'static,

Sourceยง

impl<R, Q, S> FunctionProvider for Link<R, Q, S>
where R: Routable + 'static, Q: Clone + PartialEq + Serialize + 'static, S: Clone + PartialEq + 'static,

Implementorsยง