logo
pub trait Application: 'static + Default {
    type Cmd: Command + Configurable<Self::Cfg>;
    type Cfg: Config;
    type Paths: Default + ExePath + RootPath;

Show 17 methods fn config(&self) -> &Self::Cfg; fn state(&self) -> &State<Self>; fn state_mut(&mut self) -> &mut State<Self>; fn register_components(
        &mut self,
        command: &Self::Cmd
    ) -> Result<(), FrameworkError>; fn after_config(&mut self, config: Self::Cfg) -> Result<(), FrameworkError>; fn run<I>(app_cell: &'static Cell<Lock<Self>>, args: I)
    where
        I: IntoIterator<Item = String>
, { ... } fn init(&mut self, command: &Self::Cmd) -> Result<(), FrameworkError> { ... } fn framework_components(
        &mut self,
        command: &Self::Cmd
    ) -> Result<Vec<Box<dyn Component<Self> + 'static, Global>, Global>, FrameworkError> { ... } fn load_config(&mut self, path: &Path) -> Result<Self::Cfg, FrameworkError> { ... } fn name(&self) -> &'static str { ... } fn description(&self) -> &'static str { ... } fn version(&self) -> Version { ... } fn authors(&self) -> Vec<String, Global>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator
{ ... } fn term_colors(&self, command: &Self::Cmd) -> ColorChoice { ... } fn tracing_config(&self, command: &Self::Cmd) -> Config { ... } fn handle_signal(&mut self, signal: Signal) -> Result<(), FrameworkError> { ... } fn shutdown(&mut self, shutdown: Shutdown) -> ! { ... }
}
Expand description

Commonly used Abscissa traits Application types implementing this trait own global application state, including configuration and arbitrary other values stored within application components.

Application lifecycle is handled by a set of components owned by types implementing this trait. It also ties together the following:

  • Cmd: application entrypoint
  • Config : application configuration
  • Paths: paths to various resources within the application

Required Associated Types

Application (sub)command which serves as the main entry point.

Configuration type used by this application.

Paths to application resources,

Required Methods

Accessor for application configuration.

Borrow the application state immutably.

Borrow the application state mutably.

Register all components used by this application

Post-configuration lifecycle callback.

Called regardless of whether config is loaded to indicate this is the time in app lifecycle when configuration would be loaded if possible.

This method is responsible for invoking the after_config handlers on all components in the registry. This is presently done in the standard application template, but is not otherwise handled directly by the framework (as ownership precludes it).

Provided Methods

Run application with the given command-line arguments and running the appropriate Command type.

Load this application’s configuration and initialize its components.

Initialize the framework’s default set of components, potentially sourcing terminal and tracing options from command line arguments.

Load configuration from the given path.

Returns an error if the configuration could not be loaded.

Name of this application as a string.

Description of this application.

Version of this application.

Authors of this application.

Color configuration for this application.

Get the tracing configuration for this application.

Handle a Unix signal received by this application

Shut down this application gracefully, exiting with success.

Implementors