Trait maomi::backend::Backend

source ·
pub trait Backend: 'static {
    type GeneralElement: BackendGeneralElement<BaseBackend = Self>;
    type VirtualElement: BackendVirtualElement<BaseBackend = Self>;
    type TextNode: BackendTextNode<BaseBackend = Self>;

    // Required methods
    fn async_task(fut: impl 'static + Future<Output = ()>)
       where Self: Sized;
    fn backend_stage(&self) -> BackendStage;
    fn root(&self) -> ForestNode<'_, Self::GeneralElement>;
    fn root_mut(&mut self) -> ForestNodeMut<'_, Self::GeneralElement>;
}
Expand description

The interface that a backend should implement.

This is used by the backend implementor. In most cases, it should not be used in component implementors.

Required Associated Types§

source

type GeneralElement: BackendGeneralElement<BaseBackend = Self>

The general type for a backend element.

source

type VirtualElement: BackendVirtualElement<BaseBackend = Self>

The type for a virtual element.

source

type TextNode: BackendTextNode<BaseBackend = Self>

The type for a text node.

Required Methods§

source

fn async_task(fut: impl 'static + Future<Output = ()>)where Self: Sized,

Generate an async task.

source

fn backend_stage(&self) -> BackendStage

Whether the backend is in prerendering stage.

source

fn root(&self) -> ForestNode<'_, Self::GeneralElement>

Get the root element.

source

fn root_mut(&mut self) -> ForestNodeMut<'_, Self::GeneralElement>

Get the root element.

Implementors§