pub struct OrcsApp { /* private fields */ }Expand description
ORCS Application.
Integrates the engine with HIL, input handling, and output display.
Implementations§
Source§impl OrcsApp
impl OrcsApp
Sourcepub fn builder(resolver: impl ConfigResolver + 'static) -> OrcsAppBuilder
pub fn builder(resolver: impl ConfigResolver + 'static) -> OrcsAppBuilder
Creates a new builder for OrcsApp.
The resolver is required and controls how configuration is loaded. The application retains the resolver for hot-reload support.
Sourcepub fn engine(&self) -> &OrcsEngine
pub fn engine(&self) -> &OrcsEngine
Returns a reference to the engine.
Sourcepub fn engine_mut(&mut self) -> &mut OrcsEngine
pub fn engine_mut(&mut self) -> &mut OrcsEngine
Returns a mutable reference to the engine.
Sourcepub fn config(&self) -> &OrcsConfig
pub fn config(&self) -> &OrcsConfig
Returns a reference to the loaded configuration.
Sourcepub fn reload_config(&mut self) -> Result<(), AppError>
pub fn reload_config(&mut self) -> Result<(), AppError>
Re-resolves configuration from all sources (hot-reload).
Calls the retained ConfigResolver::resolve() to get a fresh
config reflecting any file/env changes since last resolution.
§Errors
Returns AppError::Config if resolution fails.
Sourcepub fn renderer(&self) -> &ConsoleRenderer
pub fn renderer(&self) -> &ConsoleRenderer
Returns the console renderer.
Sourcepub fn pending_approval_id(&self) -> Option<&str>
pub fn pending_approval_id(&self) -> Option<&str>
Returns the pending approval ID.
Sourcepub fn session_id(&self) -> &str
pub fn session_id(&self) -> &str
Returns the current session ID.
Sourcepub fn is_resumed(&self) -> bool
pub fn is_resumed(&self) -> bool
Returns whether this session was resumed from storage.
Sourcepub fn restored_count(&self) -> usize
pub fn restored_count(&self) -> usize
Returns the number of components restored (if resumed).
Sourcepub async fn save_session(&mut self) -> Result<(), AppError>
pub async fn save_session(&mut self) -> Result<(), AppError>
Saves the current session to storage.
Transfers component snapshots from the engine into the session asset, then persists to the store.
§Errors
Returns AppError::Storage if saving fails.
Sourcepub async fn load_session(&mut self, session_id: &str) -> Result<(), AppError>
pub async fn load_session(&mut self, session_id: &str) -> Result<(), AppError>
Loads a session from storage.
§Arguments
session_id- The session ID to load
§Errors
Returns AppError::Storage if loading fails.
Sourcepub async fn run_command(&mut self, command: &str) -> Result<i32, AppError>
pub async fn run_command(&mut self, command: &str) -> Result<i32, AppError>
Runs the application in non-interactive command mode.
Sends a single command, collects output until idle, and exits.
Unlike interactive mode, raw text is sent directly without
interactive command parsing (q/y/n are sent as-is).
§Output routing
Normal/Info/Success/Debug→ stdoutWarn/Error→ stderr
§Returns
Exit code: 0 for success, 1 if errors occurred.
§Errors
Returns AppError::Io on communication errors.
Sourcepub async fn run_interactive(&mut self) -> Result<(), AppError>
pub async fn run_interactive(&mut self) -> Result<(), AppError>
Runs the application in interactive mode.
Uses a dedicated OS thread for rustyline (prompt, history, line editing) and communicates with the async main loop via channels.
All terminal output during the loop goes through ExternalPrinter
to avoid corrupting rustyline’s raw-mode terminal state.
§Errors
Returns AppError::Io on stdin read errors.
Auto Trait Implementations§
impl !RefUnwindSafe for OrcsApp
impl !UnwindSafe for OrcsApp
impl Freeze for OrcsApp
impl Send for OrcsApp
impl Sync for OrcsApp
impl Unpin for OrcsApp
impl UnsafeUnpin for OrcsApp
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
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> ⓘ
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> ⓘ
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