pub struct App { /* private fields */ }Expand description
Interactive application entry point.
Implementations§
Source§impl App
impl App
pub fn new(engine: Arc<RwLock<EngineState>>, ctx: DispatchContext) -> Self
Sourcepub fn new_with_sink(
engine: Arc<RwLock<EngineState>>,
ctx: DispatchContext,
sink: SessionSink,
) -> Self
pub fn new_with_sink( engine: Arc<RwLock<EngineState>>, ctx: DispatchContext, sink: SessionSink, ) -> Self
Construct with an active session sink — prompts and dispatcher output will be persisted.
Sourcepub fn with_events(self, rx: Receiver<EngineEvent>) -> Self
pub fn with_events(self, rx: Receiver<EngineEvent>) -> Self
Attach a broadcast receiver sourced from
WsSubscriber::events(). Received events land in
AppState::event_ring and — on broadcast lag — a
synthetic “lagged” marker is recorded so the operator
sees the drop instead of a silent pane. Takes self by
value for a fluent App::new(...).with_events(rx) pattern.
Sourcepub fn state_mut(&mut self) -> &mut AppState
pub fn state_mut(&mut self) -> &mut AppState
Mutable access for pre-launch seeding (welcome messages, retry counters, etc.).
Sourcepub async fn run(self) -> Result<AppExit, AppError>
pub async fn run(self) -> Result<AppExit, AppError>
Run the event loop until the user quits.
Returns an AppExit summary on a clean shutdown so
the caller can run post-session bookkeeping (daily wrap,
milestone writes) without having to poke at App’s
internal state. On an error, the error is returned; the
caller must assume the session did not end cleanly and
skip post-session I/O.
§Errors
Propagates any terminal I/O error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl !UnwindSafe for App
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