Trait chekov::Application
source · pub trait Application: Unpin + 'static + Send + Default {
type Storage: Storage;
// Provided methods
fn with_default() -> ApplicationBuilder<Self> { ... }
fn get_name() -> &'static str { ... }
}
Expand description
Application are high order logical seperator.
A chekov application is a simple entity that will represent a single and unique domain application.
It is used to separate and allow multiple chekov application on a single runtime.
It’s also used to define the typology of the application, like which storage will be used or how to resolve the eventbus’s event
The Application isn’t instanciate at all and it’s useless to define fields on it. It just act as a type holder for the entier system.
#[derive(Default)]
struct DefaultApp {}
impl chekov::Application for DefaultApp {
// Define that this application will use a PostgresStorage as event_store
type Storage = event_store::prelude::PostgresStorage;
}
Required Associated Types§
Provided Methods§
sourcefn with_default() -> ApplicationBuilder<Self>
fn with_default() -> ApplicationBuilder<Self>
Used to initiate the launch of the application
It will just return an ApplicationBuilder which will take care of everything.