Skip to main content

OrcsApp

Struct OrcsApp 

Source
pub struct OrcsApp { /* private fields */ }
Expand description

ORCS Application.

Integrates the engine with HIL, input handling, and output display.

Implementations§

Source§

impl OrcsApp

Source

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.

Source

pub fn engine(&self) -> &OrcsEngine

Returns a reference to the engine.

Source

pub fn engine_mut(&mut self) -> &mut OrcsEngine

Returns a mutable reference to the engine.

Source

pub fn config(&self) -> &OrcsConfig

Returns a reference to the loaded configuration.

Source

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.

Source

pub fn renderer(&self) -> &ConsoleRenderer

Returns the console renderer.

Source

pub fn pending_approval_id(&self) -> Option<&str>

Returns the pending approval ID.

Source

pub fn session_id(&self) -> &str

Returns the current session ID.

Source

pub fn is_resumed(&self) -> bool

Returns whether this session was resumed from storage.

Source

pub fn restored_count(&self) -> usize

Returns the number of components restored (if resumed).

Source

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.

Source

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.

Source

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 → stdout
  • Warn/Error → stderr
§Returns

Exit code: 0 for success, 1 if errors occurred.

§Errors

Returns AppError::Io on communication errors.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more