pub struct DebugSession { /* private fields */ }Expand description
Helper for wiring debug CLI flags into an app runtime.
Implementations§
Source§impl DebugSession
impl DebugSession
pub fn new(args: DebugCliArgs) -> Self
pub fn args(&self) -> &DebugCliArgs
pub fn enabled(&self) -> bool
pub fn render_once(&self) -> bool
pub fn use_alt_screen(&self) -> bool
pub fn action_filter(&self) -> ActionLoggerConfig
pub fn auto_fetch(&self) -> bool
pub fn load_state_or_else<S, F, E>(&self, fallback: F) -> DebugSessionResult<S>
pub async fn load_state_or_else_async<S, F, Fut, E>( &self, fallback: F, ) -> DebugSessionResult<S>
pub fn load_state_or<S, F>(&self, fallback: F) -> DebugSessionResult<S>where
S: DeserializeOwned,
F: FnOnce() -> S,
Sourcepub fn load_replay_items<A>(&self) -> DebugSessionResult<Vec<ReplayItem<A>>>where
A: DeserializeOwned,
pub fn load_replay_items<A>(&self) -> DebugSessionResult<Vec<ReplayItem<A>>>where
A: DeserializeOwned,
Load replay items from --debug-actions-in.
This auto-detects the format: either a simple Vec<A> or Vec<ReplayItem<A>>.
Both formats are supported for backwards compatibility.
Sourcepub fn load_actions<A>(&self) -> DebugSessionResult<Vec<A>>where
A: DeserializeOwned,
👎Deprecated: Use load_replay_items instead
pub fn load_actions<A>(&self) -> DebugSessionResult<Vec<A>>where
A: DeserializeOwned,
Load actions from --debug-actions-in (legacy API, ignores await markers).
pub fn action_recorder<A: Action>(&self) -> Option<DebugActionRecorder<A>>
pub fn middleware_with_recorder<S, A: Action>( &self, ) -> (ComposedMiddleware<S, A>, Option<DebugActionRecorder<A>>)
pub fn save_actions<A>( &self, recorder: Option<&DebugActionRecorder<A>>, ) -> DebugSessionResult<()>
Sourcepub fn replay_timeout(&self) -> Duration
pub fn replay_timeout(&self) -> Duration
Get the replay timeout duration from CLI args.
pub async fn run_effect_app<B, S, A, E, St, FInit, FRender, FEvent, FQuit, FEffect, R>(
&self,
terminal: &mut Terminal<B>,
store: St,
debug_layer: DebugLayer<A>,
replay_items: Vec<ReplayItem<A>>,
auto_action: Option<A>,
quit_action: Option<A>,
init_runtime: FInit,
render: FRender,
map_event: FEvent,
should_quit: FQuit,
handle_effect: FEffect,
) -> Result<DebugRunOutput<S>>where
B: Backend,
S: Clone + DebugState + Serialize + 'static,
A: Action + ActionParams,
St: EffectStoreLike<S, A, E>,
FInit: FnOnce(&mut EffectRuntime<S, A, E, St>),
FRender: FnMut(&mut Frame<'_>, Rect, &S, RenderContext),
FEvent: FnMut(&EventKind, &S) -> R,
R: Into<EventOutcome<A>>,
FQuit: FnMut(&A) -> bool,
FEffect: FnMut(E, &mut EffectContext<'_, A>),
pub async fn run_effect_app_with_bus<B, S, A, E, St, Id, Ctx, FInit, FRender, FQuit, FEffect>(
&self,
terminal: &mut Terminal<B>,
store: St,
debug_layer: DebugLayer<A>,
replay_items: Vec<ReplayItem<A>>,
auto_action: Option<A>,
quit_action: Option<A>,
init_runtime: FInit,
bus: &mut EventBus<S, A, Id, Ctx>,
keybindings: &Keybindings<Ctx>,
render: FRender,
should_quit: FQuit,
handle_effect: FEffect,
) -> Result<DebugRunOutput<S>>where
B: Backend,
S: Clone + DebugState + Serialize + EventRoutingState<Id, Ctx> + 'static,
A: Action + ActionParams,
St: EffectStoreLike<S, A, E>,
Id: ComponentId + 'static,
Ctx: BindingContext + 'static,
FInit: FnOnce(&mut EffectRuntime<S, A, E, St>),
FRender: FnMut(&mut Frame<'_>, Rect, &S, RenderContext, &mut EventContext<Id>),
FQuit: FnMut(&A) -> bool,
FEffect: FnMut(E, &mut EffectContext<'_, A>),
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DebugSession
impl RefUnwindSafe for DebugSession
impl Send for DebugSession
impl Sync for DebugSession
impl Unpin for DebugSession
impl UnsafeUnpin for DebugSession
impl UnwindSafe for DebugSession
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