pub struct SessionPicker {
pub sessions: Vec<SessionMeta>,
pub query: String,
pub filtered: Vec<usize>,
pub selected: usize,
pub rename_editing: bool,
pub rename_buffer: String,
}Fields§
§sessions: Vec<SessionMeta>All sessions for the project, pre-filtered to message_count > 0.
query: StringUser-typed filter text. Empty string = show all.
filtered: Vec<usize>Indices into sessions that match query (case-insensitive substring).
selected: usizeIndex into filtered.
rename_editing: boolWhether we are in rename editing mode.
rename_buffer: StringThe new name being edited for rename.
Implementations§
Trait Implementations§
Source§impl Modal for SessionPicker
impl Modal for SessionPicker
Source§fn handle_key(
&mut self,
code: KeyCode,
mods: KeyModifiers,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_key( &mut self, code: KeyCode, mods: KeyModifiers, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Process one keystroke. Must either fully handle it (including
any re-paint the modal wants) or report that the modal is now
done so the caller can tear it down.
Source§fn draw(
&self,
buf: &Buffer,
state: &UiState,
ctx: &LoopCtx,
renderer: &mut dyn Renderer,
)
fn draw( &self, buf: &Buffer, state: &UiState, ctx: &LoopCtx, renderer: &mut dyn Renderer, )
Paint the modal against the current terminal state. Called once
when the modal is installed into
active_modal; handle_key
is expected to handle subsequent repaints after each key.Source§fn handle_paste(
&mut self,
text: &str,
buf: &mut Buffer,
state: &mut UiState,
ctx: &mut LoopCtx,
renderer: &mut dyn Renderer,
) -> Result<ModalAction>
fn handle_paste( &mut self, text: &str, buf: &mut Buffer, state: &mut UiState, ctx: &mut LoopCtx, renderer: &mut dyn Renderer, ) -> Result<ModalAction>
Handle a bracketed-paste payload while the modal is active.
Default: append the text to
buf (so text-input wizard steps
naturally accept URL / API-key paste) and redraw. Modals that
only present pickers (no text input) can leave the default —
buf updates are harmless when the modal isn’t displaying it.Auto Trait Implementations§
impl Freeze for SessionPicker
impl RefUnwindSafe for SessionPicker
impl Send for SessionPicker
impl Sync for SessionPicker
impl Unpin for SessionPicker
impl UnsafeUnpin for SessionPicker
impl UnwindSafe for SessionPicker
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