pub struct SessionPickerState {
pub sessions: Vec<SessionInfo>,
pub filtered_indices: Vec<usize>,
pub filter: String,
pub selected: usize,
pub scroll_offset: usize,
pub loading: bool,
/* private fields */
}Fields§
§sessions: Vec<SessionInfo>§filtered_indices: Vec<usize>§filter: String§selected: usize§scroll_offset: usize§loading: boolImplementations§
Source§impl SessionPickerState
impl SessionPickerState
pub fn new(sessions: Vec<SessionInfo>, preferred_cwd: Option<&Path>) -> Self
pub fn loading(preferred_cwd: Option<&Path>) -> Self
pub fn finish_loading(&mut self, sessions: Vec<SessionInfo>)
pub fn fail_loading(&mut self)
pub fn move_up(&mut self)
pub fn move_down(&mut self)
pub fn push_filter(&mut self, c: char)
pub fn pop_filter(&mut self)
Sourcepub fn clamp_scroll(&mut self, visible_rows: usize)
pub fn clamp_scroll(&mut self, visible_rows: usize)
Adjust scroll_offset so the selected item is visible within visible_rows entries.
pub fn selected_session(&self) -> Option<&SessionInfo>
pub fn visible_sessions(&self) -> impl Iterator<Item = (usize, &SessionInfo)>
Trait Implementations§
Source§impl Clone for SessionPickerState
impl Clone for SessionPickerState
Source§fn clone(&self) -> SessionPickerState
fn clone(&self) -> SessionPickerState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionPickerState
impl RefUnwindSafe for SessionPickerState
impl Send for SessionPickerState
impl Sync for SessionPickerState
impl Unpin for SessionPickerState
impl UnsafeUnpin for SessionPickerState
impl UnwindSafe for SessionPickerState
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> 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>
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