pub struct ReplApp {Show 37 fields
pub chat: Vec<ChatLine>,
pub input_buf: String,
pub cursor_pos: usize,
pub scroll_offset: usize,
pub last_max_scroll: Arc<AtomicUsize>,
pub history: Vec<String>,
pub history_idx: Option<usize>,
pub saved_input: Option<String>,
pub show_banner: bool,
pub label: String,
pub user_label: String,
pub accent_color: Color,
pub status_prefix: String,
pub banner_title: String,
pub version: String,
pub splash: Vec<String>,
pub recent_activity: Vec<String>,
pub banner_art: Vec<Line<'static>>,
pub commands: Vec<CommandDescriptor>,
pub active_picker: Option<PickerRequest>,
pub pending_permission: Option<PendingPermission>,
pub pending_permission_response: Option<PermissionResponse>,
pub permission_error: Option<String>,
pub busy: bool,
pub cancelling: bool,
pub streaming_idx: Option<usize>,
pub delegations: Vec<Delegation>,
pub agent_streams: HashMap<(String, String), usize>,
pub tool_cards: HashMap<String, usize>,
pub statusline: Vec<StatuslineSegment>,
pub active_workstream: Option<WorkstreamSummary>,
pub quit: bool,
pub pending_submit: Option<String>,
pub pending_cancel: bool,
pub last_prompt: String,
pub last_bash_block: Option<String>,
pub current_generation: u64,
}Expand description
All mutable state the shared render/event loop needs to draw one frame.
Why: kept separate from the render/event-loop machinery (mirroring
tagent’s original rationale) so unit tests can drive state transitions
without a Terminal. See the module doc comment for what was
deliberately left out of the generalized port.
What: every field is pub (matching tagent’s style — this is a plain
data/mutator struct, not an encapsulated type) so a product binary can
seed banner/branding fields at construction without a builder API.
Fields§
§chat: Vec<ChatLine>Scrollback history of user/assistant/status exchanges.
input_buf: StringCurrent input line being edited.
cursor_pos: usizeByte offset within input_buf.
scroll_offset: usizeNumber of lines scrolled up from the bottom (0 = pinned to newest).
last_max_scroll: Arc<AtomicUsize>Last-rendered maximum scroll offset (published by the scrollback
widget each frame; scroll() clamps against it). Arc so a render
snapshot and the authoritative instance behind a caller’s mutex (if
any) share the same cell — mirrors tagent’s last_max_scroll.
history: Vec<String>Every prompt submitted this session, oldest first, with adjacent
duplicates collapsed (Self::remember_input). Up/Down walk it
(#8181).
Why: scoped to one TUI process deliberately. Persisting across
launches would need a store this crate cannot reach — it must not
depend on trusty_common (see the crate-level doc comment’s
dependency-direction constraint) and has no product-specific state
directory of its own — so cross-launch history stays with whichever
product wants it, seeding this field at construction.
history_idx: Option<usize>Index into history while navigating. None when not navigating.
saved_input: Option<String>The in-progress draft stashed by Self::history_prev’s first step
and restored by Self::history_next at the newest end (#8181).
None when not navigating.
Whether to show the welcome banner in the scrollback.
label: StringThe name shown in the chat leader (⏺ <label> · ) and the input
prompt (<label>> ). Generic replacement for tagent’s
project_name — any single display label a product wants there.
user_label: StringThe user’s display name, shown in the banner’s identity line.
accent_color: ColorAccent color for the chat leader glyph and label. Generic replacement
for tagent’s AgentScope-driven cyan/yellow — a product sets this to
whatever distinguishes its own contexts (or leaves the default).
status_prefix: StringPrefix rendered before every ChatRole::Status line (e.g.
"[tagent] "). Defaults to "[{label}] " in ReplApp::new;
override if a product wants different bracketed text than its
label.
Banner title text (defaults to label).
version: StringVersion string shown in the banner (defaults to this crate’s own version — a product should override with its own).
splash: Vec<String>Engine-supplied startup splash lines (#8164). Empty by default; when
non-empty they REPLACE the banner’s generic {banner_title} v{version} identity row rather than stacking above or below it, so a
product that knows its own launch facts states them once. Set from
crate::event::ReplEvent::SplashUpdated, which is also where the
content contract lives.
recent_activity: Vec<String>Recent-activity lines shown in the banner’s right column. Generic
replacement for tagent’s git_commits — a product decides what
“recent activity” means for it (or supplies none).
Optional pre-rendered left-column art (e.g. a splash logo). Empty by default — this crate has no branding assets of its own (see the dependency-direction constraint in the crate-level doc comment: this crate must not depend on a product-specific art asset).
commands: Vec<CommandDescriptor>Slash commands shown in the banner’s “Commands” section, sourced from
crate::engine::TuiEngine::commands plus any client-side built-ins.
active_picker: Option<PickerRequest>An inline picker currently open for selection (DOC-50 §3.2/§6 Q6),
staged by crate::commands::dispatch_forward when a bare /name
submission matches TuiEngine::picker(name). None when no picker
is open. The picker WIDGET itself (navigation/rendering) is a
follow-up slice’s concern (DOC-50 §5 Slice 7’s deliverable scopes
“routing correctness”, not the visual overlay); this field is the
data half of that contract.
pending_permission: Option<PendingPermission>The permission request currently blocking the turn (#3422), or None
when nothing is pending.
Why: a suspended tool call is a second, independent reason input must
not be accepted — Self::busy cannot express it, because the
backend is stopped rather than working. Self::submit_line refuses
while this is Some, exactly as it refuses while busy, and
reduce::apply_key routes every key to the decision bindings.
What: set by crate::event::ReplEvent::PermissionRequested, cleared
by a matching PermissionResolved or by the user answering.
pending_permission_response: Option<PermissionResponse>An answer staged for the outer driver to relay to
crate::engine::TuiEngine::respond_permission (#3422). Drained by
TuiModel::take_pending_permission_response, same as
Self::pending_submit.
permission_error: Option<String>Why the last answer to Self::pending_permission never reached the
backend (#3422), rendered as an inline retry line on the reopened
prompt; None on a prompt that has not been answered yet.
Why: reopening the prompt alone would look like the backend asked
twice. The operator needs to know their answer was lost, not
re-asked, before choosing again.
What: set by crate::event::ReplEvent::PermissionAnswerFailed,
cleared whenever the prompt is opened, answered, or resolved.
busy: boolWhether a response is currently streaming in. Drives the input composer’s placeholder text.
cancelling: boolWhether a dispatched cancel is still unconfirmed (#8207).
Why: the daemon’s session.cancel only returns once the run has
actually stopped, and can answer “not stopped yet”. Between the Ctrl-C
and that answer the turn may still be running, so the TUI shows a
cancelling state and accepts no new prompt — printing “cancelled” and
reopening input on request is what earned the next prompt a
-32003 already has a task running refusal in #8207’s transcript.
What: set by TuiModel::on_cancel_requested when the cancel is
dispatched, cleared by crate::event::ReplEvent::CancelSettled on
every arm except crate::model::CancelReply::StillCancelling, which
keeps it set because the run genuinely has not stopped. Read by
Self::accepts_submit and by
crate::widgets::input_composer’s label.
streaming_idx: Option<usize>Index into chat of the in-progress streaming assistant entry, if
any. None when idle.
delegations: Vec<Delegation>Delegated sub-agents whose scrollback block is currently open, in
first-seen order (#7940). Pushed by
crate::event::ReplEvent::DelegationStarted, removed by
DelegationFinished. The last entry names the agent the status line
shows — see Self::active_agent.
agent_streams: HashMap<(String, String), usize>Index into chat of the in-progress bubble for one (agent_id, turn_id) stream (#7940). Separate from Self::streaming_idx —
which is the single unkeyed slot
crate::event::ReplEvent::AssistantOutput uses — precisely so two
agents streaming at once cannot land in one bubble.
tool_cards: HashMap<String, usize>Index into chat of the card for each in-flight tool call, keyed by
the call’s id (#4596). Inserted when a call starts; removed when its
result lands in that card.
statusline: Vec<StatuslineSegment>Engine-supplied statusline segments, most recently pushed via
crate::event::ReplEvent::StatuslineUpdate.
active_workstream: Option<WorkstreamSummary>The active workstream, most recently pushed via
crate::event::ReplEvent::WorkstreamUpdated.
quit: boolQuit signal — set on Ctrl-D. Backs TuiModel::should_quit.
pending_submit: Option<String>A line the user just submitted (typed Enter, or a synthesized
ReplEvent::Submit), staged for the outer driver to forward to
TuiEngine::handle_input. apply cannot reach the engine or the
event channel itself (see [reduce]’s doc comment), so — mirroring
tagent’s pending_picker_selection/pending_submit pattern — it
stashes the line here instead. Drained (Option::take) by the
caller after each apply call.
pending_cancel: boolSet when the user pressed Ctrl-C. Drained by the caller, which should
call TuiEngine::cancel_session (thin-client axiom C-2 — cancellation
is the backend’s job, not just clearing local UI state).
last_prompt: StringThe most recently submitted line. Direct port of tagent’s
last_prompt, kept as a plain snapshot a product can read.
Why: Up-arrow no longer reads it (#8181 moved recall to
Self::history/Self::history_idx); the field stays because it
is published API and costs one String clone per submit.
last_bash_block: Option<String>The most recently seen executable-shell (bash/sh/zsh/fish) fenced
code block across all assistant messages, updated by
Self::update_last_bash_block. Ctrl-E pastes this block’s first
non-blank line into an empty input buffer — direct port of tagent’s
last_bash_block (crates/trusty-agents/src/repl/tui/types.rs).
current_generation: u64The generation number of the turn currently considered “live” —
mirrors crate::run::dispatch_pending’s AtomicU64 counter, updated
via TuiModel::set_current_generation on the SAME serial
event-loop task that owns that counter (never from a spawned task).
A ReplEvent::TurnFinished { generation } whose generation no
longer matches this field is a stale signal from a superseded turn
and is ignored — see that variant’s doc comment for the TOCTOU race
this by-construction design closes (the comparison happens here, in
the reducer, serially — never as a spawned task’s load-then-branch
against the shared counter).
Implementations§
Source§impl ReplApp
impl ReplApp
Sourcepub fn new(label: impl Into<String>, user_label: impl Into<String>) -> Self
pub fn new(label: impl Into<String>, user_label: impl Into<String>) -> Self
Construct a fresh app with sensible generic defaults.
Why: every field needs some value; the defaults chosen here (empty
scrollback, banner visible, cyan accent, no commands/art yet) mirror
tagent’s ReplApp::new starting state minus the fields that didn’t
survive generalization.
What: label/user_label seed both the derived status_prefix and
banner_title — override those two afterward if a product wants
different text than a straight derivation from label.
Sourcepub fn push_user(&mut self, text: impl Into<String>)
pub fn push_user(&mut self, text: impl Into<String>)
Append a user prompt line to the chat scrollback.
Sourcepub fn push_assistant(&mut self, text: impl Into<String>, is_error: bool)
pub fn push_assistant(&mut self, text: impl Into<String>, is_error: bool)
Append an assistant response to the chat scrollback, trimming surrounding and interior blank lines first.
Why: assistant/agent responses regularly arrive with leading/trailing
blank lines and markdown-style \n\n paragraph breaks; rendering
them verbatim leaves visible dead space. See crate::text for the
two trimming passes.
Test: reduce::tests::push_assistant_trims_surrounding_blanks.
Sourcepub fn update_last_bash_block(&mut self)
pub fn update_last_bash_block(&mut self)
Rescan self.chat and refresh Self::last_bash_block with the
last executable-shell fenced block seen across all assistant
messages, newest-first. Direct port of tagent’s
ReplApp::update_last_bash_block
(crates/trusty-agents/src/repl/tui/app.rs).
Why: called after every chat mutation that could introduce or
obsolete a shell block (Self::push_assistant, and the streaming
finalize path in [reduce]) so Ctrl-E’s paste buffer never goes
stale relative to chat.
What: walks chat newest-to-oldest; the first ChatRole::Assistant
entry containing an executable shell fence wins (errors and user/
status entries are skipped — an error entry is never a paste source).
None when no assistant entry has one.
Test: reduce::tests::push_assistant_updates_last_bash_block,
reduce::tests::push_assistant_skips_error_entries_for_bash_block.
Sourcepub fn push_status(&mut self, text: impl Into<String>)
pub fn push_status(&mut self, text: impl Into<String>)
Append a status line (rendered with Self::status_prefix).
Sourcepub fn clear_scrollback(&mut self)
pub fn clear_scrollback(&mut self)
Clear the scrollback (backs ReplEvent::ClearScrollback, the shared
/clear built-in per DOC-50 §5 Slice 7).
Sourcepub fn active_agent(&self) -> Option<&str>
pub fn active_agent(&self) -> Option<&str>
The delegated agent whose work is currently in flight, if any (#7940).
Why: the status line shows “who is working right now”; that is the
most recently opened, not-yet-closed delegation, and it must revert
on its own when the block closes rather than needing the engine to
push a statusline update.
What: the last entry of Self::delegations; None when no
delegation is open.
Test: delegation_started_pushes_header_and_sets_active_agent,
delegation_finished_pushes_footer_and_clears_active_agent,
build_statusline_appends_active_agent_while_delegating.
Sourcepub fn toggle_last_tool_card(&mut self) -> bool
pub fn toggle_last_tool_card(&mut self) -> bool
Expand or collapse the newest tool-call card in the scrollback (#4596).
Why: this TUI has no card-focus concept — nothing moves a selection
between scrollback entries — so “the focused card” is the most recent
one, which is also the one the user just watched arrive and the only
one still on screen at scroll offset 0. A focus ring would be a
bigger surface than the toggle it serves.
What: walks chat newest-first for the first entry carrying a
ChatLine::tool and flips its ToolCard::collapsed. No-op when
no card exists. Returns true when a card was toggled, so a caller
can tell “nothing to toggle” from “toggled”.
Test: reduce::tests::ctrl_o_toggles_the_newest_tool_card_round_trip,
reduce::tests::ctrl_o_is_a_noop_when_no_tool_card_exists.
Sourcepub fn open_picker(&mut self, request: PickerRequest)
pub fn open_picker(&mut self, request: PickerRequest)
Open an inline picker (DOC-50 §3.2/§6 Q6), staged by
crate::commands::dispatch_forward for a bare command matching
TuiEngine::picker(name).
Sourcepub fn close_picker(&mut self)
pub fn close_picker(&mut self)
Close the active picker without a selection (e.g. Esc). No-op if none is open.
Sourcepub fn confirm_picker_selection(&mut self, index: usize) -> Option<String>
pub fn confirm_picker_selection(&mut self, index: usize) -> Option<String>
Confirm the picker item at index, closing the picker and returning
the composed "{dispatch_command} {selected.id}" line
(crate::commands::compose_selection) to resubmit — mirrors
crate::model::PickerRequest’s documented contract. Returns None
(leaving the picker untouched) when no picker is open or index is
out of range, so a stale/invalid confirmation is a no-op rather than
a panic.
Test: crate::commands::tests::confirm_picker_selection_composes_and_closes,
crate::commands::tests::confirm_picker_selection_out_of_range_is_noop.
Sourcepub fn accepts_submit(&self) -> bool
pub fn accepts_submit(&self) -> bool
Whether the backend can be handed a new turn right now (#8207).
Why: three independent conditions mean “the backend will refuse new
work” — a turn in flight (Self::busy), a suspended permission
request (Self::pending_permission), and a dispatched cancel the
backend has not confirmed yet (Self::cancelling). They were checked
ad hoc in two places, so the cancel window was easy to add to one and
miss in the other; one predicate makes both call sites ask the same
question. The Enter key must consult it BEFORE taking the input buffer,
or the typed line is consumed and then dropped by
Self::submit_line’s own guard.
What: pure read, no mutation. false does not mean the keystroke is
lost — reduce::apply_key queues the typed text in the composer
instead (#8240). Not a link: it is a private free function in a private
module, which rustdoc cannot resolve at all under
deny(rustdoc::broken_intra_doc_links).
Test: reduce::tests::a_prompt_submitted_while_cancelling_is_not_dispatched,
reduce::tests::an_unsettled_cancel_keeps_input_closed_after_the_turn_finished_on_its_own
(the only case where Self::cancelling is the deciding term — busy
closes the gate in the others),
reduce::tests::apply_cancel_settled_stopped_reopens_input.
Sourcepub fn answer_permission(&mut self, answer: PermissionAnswer)
pub fn answer_permission(&mut self, answer: PermissionAnswer)
Answer the open permission prompt (#3422), staging the answer for the outer driver and releasing the input block.
Why: the prompt is modal, so it must close the moment the user
answers rather than waiting on the RPC — the same reasoning
TuiModel::on_cancel_requested documents for entering the cancelling
state ahead of the cancel RPC. A backend that is slow to confirm must
not leave the keyboard dead. The backend’s own
crate::event::ReplEvent::PermissionResolved is what records the
outcome in the scrollback; this method records nothing, because the
TUI’s belief about the decision is not evidence that it was applied.
What: no-op when no prompt is open. Otherwise takes the prompt and
stages Self::pending_permission_response carrying it whole, so a
relay that fails can hand the same request back (#3422 — see
crate::event::ReplEvent::PermissionAnswerFailed). Also clears
Self::permission_error: this attempt has not failed yet, and a
stale retry line must not survive onto it.
Test: reduce::tests::permission_key_y_answers_allow_once,
reduce::tests::permission_key_a_answers_allow_for_session,
reduce::tests::permission_key_n_answers_deny,
reduce::tests::permission_unbound_key_leaves_the_prompt_pending,
crate::run::tests::dispatch_pending_permission_answer_failure_reopens_the_prompt.
Sourcepub fn remember_input(&mut self, line: &str)
pub fn remember_input(&mut self, line: &str)
Push a line onto Self::history, deduping an immediate repeat
(readline’s ignoredups convention, #8181).
Why: submitting the same prompt twice in a row should cost one Up
press to recall, not two.
What: blank/whitespace-only lines are never recorded; a line equal to
the current newest entry is dropped. A repeat that is NOT adjacent is
kept, so the walk order still reflects what was actually run.
Test: reduce::tests::consecutive_duplicate_submissions_are_stored_once,
reduce::tests::submitting_appends_to_history_and_resets_the_cursor.
Sourcepub fn set_input(&mut self, s: String)
pub fn set_input(&mut self, s: String)
Set the input buffer + cursor in one shot (cursor moves to the end).
Sourcepub fn insert_char(&mut self, c: char)
pub fn insert_char(&mut self, c: char)
Insert a single character at the cursor.
Why: editing does NOT end history navigation (#8181). It used to
clear Self::history_idx while leaving Self::saved_input set,
so Up-then-type stranded the draft with no way back — and Backspace
and Ctrl-U never cleared it at all, making the same gesture behave
three ways. Readline’s rule is the consistent one: the draft is
yours until you submit, and Down always walks back to it. Editing a
RECALLED entry still discards that edit when you navigate away;
per-entry edit buffers are not worth the state.
Sourcepub fn cursor_left(&mut self)
pub fn cursor_left(&mut self)
Move the cursor left one char-boundary.
Sourcepub fn cursor_right(&mut self)
pub fn cursor_right(&mut self)
Move the cursor right one char-boundary.
Sourcepub fn history_prev(&mut self)
pub fn history_prev(&mut self)
Up-arrow history navigation: step one entry older, saving the in-progress draft on the first step (#8181).
Why: the draft the user was typing must survive a walk through
history and come back when they walk forward past the newest entry —
losing it is the failure readline’s saved_input slot exists to
prevent.
What: no-op on an empty history. The first step (history_idx == None) stashes input_buf into Self::saved_input and lands on the
newest entry; later steps move one older. At the oldest entry the key
does NOTHING rather than re-reading history[0] into the buffer —
since #8181 made editing keep you in history, a clamp that still
called set_input silently destroyed an in-place edit of the oldest
entry. The cursor moves to the end of a recalled line
(Self::set_input).
Test: reduce::tests::apply_up_walks_back_through_submitted_prompts,
reduce::tests::apply_down_walks_forward_and_restores_the_draft,
reduce::tests::apply_up_clamps_at_the_oldest_entry,
reduce::tests::apply_up_at_the_oldest_entry_keeps_an_in_place_edit.
Sourcepub fn history_next(&mut self)
pub fn history_next(&mut self)
Down-arrow history navigation: step one entry newer, restoring the saved draft once past the newest entry (#8181).
Why: the other half of Self::history_prev’s contract — walking
forward off the newest entry returns the user to what they were
typing, not to an empty line.
What: no-op when not navigating (history_idx == None), so Down on a
freshly typed line never clobbers it. Stepping past the newest entry
clears history_idx and restores Self::saved_input (empty string
when the draft was empty). Editing while navigating does not end
navigation — see Self::insert_char — so the draft survives
typing, Backspace and Ctrl-U alike.
Test: reduce::tests::apply_down_walks_forward_and_restores_the_draft,
reduce::tests::apply_down_is_noop_when_not_navigating_history,
reduce::tests::editing_a_recalled_entry_still_leaves_down_the_draft.
Sourcepub fn take_input(&mut self) -> Option<String>
pub fn take_input(&mut self) -> Option<String>
Take the current input buffer and reset the editor state. Returns
None if the trimmed buffer was empty (nothing to submit).
Trait Implementations§
Source§impl TuiModel for ReplApp
impl TuiModel for ReplApp
Source§fn take_pending_submit(&mut self) -> Option<String>
fn take_pending_submit(&mut self) -> Option<String>
Drain Self::pending_submit — see crate::run::dispatch_pending
(private to crate::run, called from crate::run::run) for the
caller that reads this after every apply call.
Source§fn take_pending_cancel(&mut self) -> bool
fn take_pending_cancel(&mut self) -> bool
Drain-and-clear Self::pending_cancel.
Source§fn take_pending_permission_response(&mut self) -> Option<PermissionResponse>
fn take_pending_permission_response(&mut self) -> Option<PermissionResponse>
Drain Self::pending_permission_response (#3422) — see
crate::run::dispatch_pending for the caller.
Source§fn on_cancel_requested(&mut self)
fn on_cancel_requested(&mut self)
Enter the cancelling state the moment a cancel is dispatched (#8207).
Why: this used to clear Self::busy and push “cancelled” here, ahead
of the RPC — the bug in #8207. The daemon’s cancel is cooperative, so
on request the run may still be executing; saying “cancelled” and
reopening input let the next prompt reach a daemon that still had a task
running, and the user saw a raw
-32003 already has a task running instead. busy therefore STAYS set
until crate::event::ReplEvent::CancelSettled reports a confirmed
stop, which is also what keeps #8240’s queued-input behaviour covering
the cancel window: keystrokes and Enter accumulate in the composer
instead of starting a turn the backend would refuse.
What: sets Self::cancelling, abandons the in-progress streaming
entry index (a later response starts a fresh chat entry rather than
appending to one no more chunks will ever arrive for), and pushes a
“cancelling…” status line. It deliberately reports no outcome — the
TUI’s belief about the cancel is not evidence the run stopped, the same
reasoning Self::answer_permission records for a permission answer.
Test: reduce::tests::a_prompt_submitted_while_cancelling_is_not_dispatched,
crate::run::tests::dispatch_pending_cancel_holds_input_until_the_reply_lands.
Source§fn set_current_generation(&mut self, generation: u64)
fn set_current_generation(&mut self, generation: u64)
Record generation into Self::current_generation — see
crate::run::TuiModel::set_current_generation’s doc comment for
why this is called only from dispatch_pending on the serial
event-loop task, and ReplEvent::TurnFinished’s doc comment for
the race this by-construction design closes.
Test: reduce::tests::apply_turn_finished_with_stale_generation_is_ignored,
reduce::tests::apply_turn_finished_clears_busy_and_streaming_idx_without_touching_chat.
Source§fn should_quit(&self) -> bool
fn should_quit(&self) -> bool
Auto Trait Implementations§
impl Forget for ReplApp
impl Freeze for ReplApp
impl Move for ReplApp
impl RefUnwindSafe for ReplApp
impl Send for ReplApp
impl Sync for ReplApp
impl Unpin for ReplApp
impl UnsafeUnpin for ReplApp
impl UnwindSafe for ReplApp
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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