pub trait Plugin:
Policy
+ Send
+ Sync
+ Sized
+ 'static {
type Config: DeserializeOwned + Default + Send + 'static;
type Error: Error + Send + Sync + 'static;
type Context: Context;
type Resources: Send + Sync + 'static;
// Required methods
fn resources(&self) -> Arc<Self::Resources> ⓘ;
fn prepare(config: Self::Config) -> Result<Self, Self::Error>;
fn initialize(
&mut self,
context: &Self::Context,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn bind_operations(
&self,
table: &mut WireTable<Self::Context>,
) -> Result<(), ServingError>;
fn stop(
&mut self,
context: &Self::Context,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn cleanup(
&mut self,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
// Provided methods
fn register(_registrar: &mut Registrar) -> Result<(), RegistrationError> { ... }
fn attachment(&self) -> Option<Arc<dyn Attachment<Self::Context>>> { ... }
}Required Associated Types§
type Config: DeserializeOwned + Default + Send + 'static
type Error: Error + Send + Sync + 'static
type Context: Context
type Resources: Send + Sync + 'static
Required Methods§
fn resources(&self) -> Arc<Self::Resources> ⓘ
fn prepare(config: Self::Config) -> Result<Self, Self::Error>
fn initialize( &mut self, context: &Self::Context, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn bind_operations( &self, table: &mut WireTable<Self::Context>, ) -> Result<(), ServingError>
fn stop( &mut self, context: &Self::Context, ) -> impl Future<Output = Result<(), Self::Error>> + Send
fn cleanup(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send
Provided Methods§
fn register(_registrar: &mut Registrar) -> Result<(), RegistrationError>
fn attachment(&self) -> Option<Arc<dyn Attachment<Self::Context>>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".