pub struct RusticApp {
config: CfgCell<RusticConfig>,
state: State<Self>,
}Expand description
Rustic Application
Fields§
§config: CfgCell<RusticConfig>Application configuration.
state: State<Self>Application state.
Trait Implementations§
Source§impl Application for RusticApp
impl Application for RusticApp
Source§type Cmd = EntryPoint
type Cmd = EntryPoint
Entrypoint command for this application.
Source§type Cfg = RusticConfig
type Cfg = RusticConfig
Application configuration.
Source§type Paths = StandardPaths
type Paths = StandardPaths
Paths to resources within the application.
Source§fn config(&self) -> Reader<RusticConfig>
fn config(&self) -> Reader<RusticConfig>
Accessor for application configuration.
Source§fn framework_components(
&mut self,
command: &Self::Cmd,
) -> Result<Vec<Box<dyn Component<Self>>>, FrameworkError>
fn framework_components( &mut self, command: &Self::Cmd, ) -> Result<Vec<Box<dyn Component<Self>>>, FrameworkError>
Returns the framework components used by this application.
Source§fn register_components(
&mut self,
command: &Self::Cmd,
) -> Result<(), FrameworkError>
fn register_components( &mut self, command: &Self::Cmd, ) -> Result<(), FrameworkError>
Register all components used by this application.
If you would like to add additional components to your application beyond the default ones provided by the framework, this is the place to do so.
Source§fn after_config(&mut self, config: Self::Cfg) -> Result<(), FrameworkError>
fn after_config(&mut self, config: Self::Cfg) -> Result<(), FrameworkError>
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.
Source§fn shutdown_with_exitcode(&self, shutdown: Shutdown, exit_code: i32) -> !
fn shutdown_with_exitcode(&self, shutdown: Shutdown, exit_code: i32) -> !
Shut down this application gracefully, exiting with given exit code.
Source§fn run<I, T>(app_cell: &'static AppCell<Self>, args: I)
fn run<I, T>(app_cell: &'static AppCell<Self>, args: I)
Run application with the given command-line arguments and running the
appropriate
Command type.Source§fn init(&mut self, command: &Self::Cmd) -> Result<(), FrameworkError>
fn init(&mut self, command: &Self::Cmd) -> Result<(), FrameworkError>
Load this application’s configuration and initialize its components.
Source§fn load_config(&mut self, path: &Path) -> Result<Self::Cfg, FrameworkError>
fn load_config(&mut self, path: &Path) -> Result<Self::Cfg, FrameworkError>
Load configuration from the given path. Read more
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Description of this application.
Authors of this application.
Source§fn term_colors(&self, command: &Self::Cmd) -> ColorChoice
fn term_colors(&self, command: &Self::Cmd) -> ColorChoice
Color configuration for this application.
Source§fn tracing_config(&self, command: &Self::Cmd) -> Config
fn tracing_config(&self, command: &Self::Cmd) -> Config
Get the tracing configuration for this application.
Auto Trait Implementations§
impl !Freeze for RusticApp
impl RefUnwindSafe for RusticApp
impl Send for RusticApp
impl Sync for RusticApp
impl Unpin for RusticApp
impl UnwindSafe for RusticApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more