pub trait Component:
Send
+ Sync
+ 'static {
// Required method
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 ComponentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ComponentOutput, ThemeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn properties(&self) -> Vec<PropertyDef> { ... }
fn markup(&self) -> Option<&'static str> { ... }
}Expand description
A compiled unit a page attaches.
Required Methods§
Sourcefn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 ComponentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ComponentOutput, ThemeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn run<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cx: &'life1 ComponentContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ComponentOutput, ThemeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Produces the data for one request.
Provided Methods§
Sourcefn properties(&self) -> Vec<PropertyDef>
fn properties(&self) -> Vec<PropertyDef>
The properties an attachment may set.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".