pub trait HandlerState:
'static
+ Sync
+ Send
+ Sized {
type StoreData: Send;
type WorkerExpiration: WorkerExpiration;
type WorkerState: WorkerState<StoreData = Self::StoreData>;
// Required method
fn instantiate(
&self,
) -> impl Future<Output = Result<Instance<Self::StoreData, Self::WorkerExpiration, Self::WorkerState>>> + Send;
}Available on crate feature
component-model-async only.Expand description
Represents the application-specific state of a web server.
Required Associated Types§
Sourcetype StoreData: Send
type StoreData: Send
The type of the associated data for Stores created using
Self::instantiate.
Sourcetype WorkerExpiration: WorkerExpiration
type WorkerExpiration: WorkerExpiration
The type of the WorkerExpiration implementation to be returned from
Self::instantiate.
Sourcetype WorkerState: WorkerState<StoreData = Self::StoreData>
type WorkerState: WorkerState<StoreData = Self::StoreData>
The type of the WorkerState implementation to be returned from
Self::instantiate.
Required Methods§
Sourcefn instantiate(
&self,
) -> impl Future<Output = Result<Instance<Self::StoreData, Self::WorkerExpiration, Self::WorkerState>>> + Send
fn instantiate( &self, ) -> impl Future<Output = Result<Instance<Self::StoreData, Self::WorkerExpiration, Self::WorkerState>>> + Send
Create a new store and instance for handling one or more requests.
Note that the implementer is responsible for applying a timeout to the guest instantiation if appropriate (e.g. as part of an overall request timeout).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".