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§
sourcetype GeneralElement: BackendGeneralElement<BaseBackend = Self>
type GeneralElement: BackendGeneralElement<BaseBackend = Self>
The general type for a backend element.
sourcetype VirtualElement: BackendVirtualElement<BaseBackend = Self>
type VirtualElement: BackendVirtualElement<BaseBackend = Self>
The type for a virtual element.
sourcetype TextNode: BackendTextNode<BaseBackend = Self>
type TextNode: BackendTextNode<BaseBackend = Self>
The type for a text node.
Required Methods§
sourcefn async_task(fut: impl 'static + Future<Output = ()>)where
Self: Sized,
fn async_task(fut: impl 'static + Future<Output = ()>)where Self: Sized,
Generate an async task.
sourcefn backend_stage(&self) -> BackendStage
fn backend_stage(&self) -> BackendStage
Whether the backend is in prerendering stage.
sourcefn root(&self) -> ForestNode<'_, Self::GeneralElement>
fn root(&self) -> ForestNode<'_, Self::GeneralElement>
Get the root element.
sourcefn root_mut(&mut self) -> ForestNodeMut<'_, Self::GeneralElement>
fn root_mut(&mut self) -> ForestNodeMut<'_, Self::GeneralElement>
Get the root element.