Trait spin_app::DynamicHostComponent
source · pub trait DynamicHostComponent: HostComponent {
// Required method
fn update_data(
&self,
data: &mut Self::Data,
component: &AppComponent<'_>
) -> Result<()>;
// Provided method
fn validate_app(&self, app: &App<'_>) -> Result<()> { ... }
}
Expand description
A trait for “dynamic” Spin host components.
This extends HostComponent
to support per-AppComponent
dynamic
runtime configuration.
Dynamic host components differ from regular host components in that they can be configured on a per-component basis.
Required Methods§
sourcefn update_data(
&self,
data: &mut Self::Data,
component: &AppComponent<'_>
) -> Result<()>
fn update_data( &self, data: &mut Self::Data, component: &AppComponent<'_> ) -> Result<()>
Called on AppComponent
instance initialization.
The data
returned by HostComponent::build_data
is passed, along
with a reference to the component
being instantiated.
Provided Methods§
Object Safety§
This trait is not object safe.