pub struct CliContext { /* private fields */ }Expand description
CLI execution context.
Contains shared state and configuration for all commands.
Implementations§
Source§impl CliContext
impl CliContext
Sourcepub fn builder() -> CliContextBuilder
pub fn builder() -> CliContextBuilder
Create a new CLI context builder.
Sourcepub async fn engine(&self) -> CliResult<Arc<RwLock<Option<SimulatorEngine>>>>
pub async fn engine(&self) -> CliResult<Arc<RwLock<Option<SimulatorEngine>>>>
Get the simulator engine, creating it if necessary.
Sourcepub fn engine_ref(&self) -> &Arc<RwLock<Option<SimulatorEngine>>>
pub fn engine_ref(&self) -> &Arc<RwLock<Option<SimulatorEngine>>>
Get the raw engine reference.
Sourcepub fn engine_config(&self) -> &EngineConfig
pub fn engine_config(&self) -> &EngineConfig
Get the engine configuration.
Sourcepub fn log_config(&self) -> &LogConfig
pub fn log_config(&self) -> &LogConfig
Get the log configuration.
Sourcepub fn metrics(&self) -> &Arc<MetricsCollector>
pub fn metrics(&self) -> &Arc<MetricsCollector>
Get the metrics collector.
Sourcepub fn output(&self) -> &OutputWriter
pub fn output(&self) -> &OutputWriter
Get the output writer.
Sourcepub fn output_mut(&mut self) -> &mut OutputWriter
pub fn output_mut(&mut self) -> &mut OutputWriter
Get the output writer mutably.
Sourcepub fn working_dir(&self) -> &PathBuf
pub fn working_dir(&self) -> &PathBuf
Get the working directory.
Sourcepub fn is_verbose(&self) -> bool
pub fn is_verbose(&self) -> bool
Check if verbose mode is enabled.
Sourcepub fn colors_enabled(&self) -> bool
pub fn colors_enabled(&self) -> bool
Check if colors are enabled.
Sourcepub fn shutdown_signal(&self) -> Arc<Notify>
pub fn shutdown_signal(&self) -> Arc<Notify>
Get the shutdown signal.
Sourcepub fn signal_shutdown(&self)
pub fn signal_shutdown(&self)
Signal shutdown.
Sourcepub fn resolve_path(&self, path: impl AsRef<Path>) -> PathBuf
pub fn resolve_path(&self, path: impl AsRef<Path>) -> PathBuf
Resolve a path relative to the working directory.
Auto Trait Implementations§
impl Freeze for CliContext
impl !RefUnwindSafe for CliContext
impl Send for CliContext
impl Sync for CliContext
impl Unpin for CliContext
impl UnsafeUnpin for CliContext
impl !UnwindSafe for CliContext
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> 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