ayun_core::traits

Trait InstanceTrait

Source
pub trait InstanceTrait:
    Any
    + Send
    + Sync {
    // Required method
    fn register(container: &Container) -> Result<Self, ContainerError>
       where Self: Sized;

    // Provided methods
    fn name() -> String { ... }
    fn boot() -> Result<(), ContainerError>
       where Self: Sized { ... }
    fn cleanup() -> Result<(), ContainerError> { ... }
    fn facade() -> &'static Self
       where Self: Sized { ... }
}

Required Methods§

Source

fn register(container: &Container) -> Result<Self, ContainerError>
where Self: Sized,

Provided Methods§

Source

fn name() -> String

Source

fn boot() -> Result<(), ContainerError>
where Self: Sized,

Source

fn cleanup() -> Result<(), ContainerError>

Source

fn facade() -> &'static Self
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§