pub struct SessionWidget {
pub sessions: Vec<Session>,
pub selected_index: usize,
pub display_mode: SessionDisplayMode,
pub visible: bool,
pub scroll_offset: usize,
pub max_visible: usize,
}Expand description
Session widget for displaying and managing sessions
Fields§
§sessions: Vec<Session>All sessions
selected_index: usizeCurrently selected session index
display_mode: SessionDisplayModeDisplay mode (tabs or list)
visible: boolWhether the session panel is visible
scroll_offset: usizeScroll offset for list view
max_visible: usizeMaximum visible sessions in list view
Implementations§
Source§impl SessionWidget
impl SessionWidget
Sourcepub fn add_session(&mut self, session: Session)
pub fn add_session(&mut self, session: Session)
Add a new session
Sourcepub fn remove_session(&mut self, index: usize) -> Option<Session>
pub fn remove_session(&mut self, index: usize) -> Option<Session>
Remove a session by index
Sourcepub fn current_session(&self) -> Option<&Session>
pub fn current_session(&self) -> Option<&Session>
Get the currently selected session
Sourcepub fn current_session_mut(&mut self) -> Option<&mut Session>
pub fn current_session_mut(&mut self) -> Option<&mut Session>
Get mutable reference to the currently selected session
Sourcepub fn switch_to_session(&mut self, index: usize) -> bool
pub fn switch_to_session(&mut self, index: usize) -> bool
Switch to a session by index
Sourcepub fn switch_to_session_by_id(&mut self, id: &str) -> bool
pub fn switch_to_session_by_id(&mut self, id: &str) -> bool
Switch to a session by ID
Sourcepub fn next_session(&mut self) -> bool
pub fn next_session(&mut self) -> bool
Get the next session
Sourcepub fn previous_session(&mut self) -> bool
pub fn previous_session(&mut self) -> bool
Get the previous session
Sourcepub fn rename_session(&mut self, index: usize, new_name: String) -> bool
pub fn rename_session(&mut self, index: usize, new_name: String) -> bool
Rename a session
Sourcepub fn rename_current_session(&mut self, new_name: String) -> bool
pub fn rename_current_session(&mut self, new_name: String) -> bool
Rename the current session
Sourcepub fn toggle_display_mode(&mut self)
pub fn toggle_display_mode(&mut self)
Toggle display mode between tabs and list
Sourcepub fn set_display_mode(&mut self, mode: SessionDisplayMode)
pub fn set_display_mode(&mut self, mode: SessionDisplayMode)
Set display mode
Sourcepub fn toggle_visibility(&mut self)
pub fn toggle_visibility(&mut self)
Toggle visibility
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down in list view
Sourcepub fn visible_sessions(&self) -> Vec<&Session>
pub fn visible_sessions(&self) -> Vec<&Session>
Get visible sessions for list view
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Get the number of sessions
Sourcepub fn has_sessions(&self) -> bool
pub fn has_sessions(&self) -> bool
Check if there are any sessions
Sourcepub fn get_session(&self, id: &str) -> Option<&Session>
pub fn get_session(&self, id: &str) -> Option<&Session>
Get session by ID
Sourcepub fn get_session_mut(&mut self, id: &str) -> Option<&mut Session>
pub fn get_session_mut(&mut self, id: &str) -> Option<&mut Session>
Get mutable session by ID
Sourcepub fn session_ids(&self) -> Vec<&str>
pub fn session_ids(&self) -> Vec<&str>
Get all session IDs
Sourcepub fn session_names(&self) -> Vec<&str>
pub fn session_names(&self) -> Vec<&str>
Get all session names
Sourcepub fn find_session_index(&self, id: &str) -> Option<usize>
pub fn find_session_index(&self, id: &str) -> Option<usize>
Find session index by ID
Sourcepub fn selected_index(&self) -> usize
pub fn selected_index(&self) -> usize
Get the selected session index
Sourcepub fn display_mode(&self) -> SessionDisplayMode
pub fn display_mode(&self) -> SessionDisplayMode
Get the display mode
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Check if visible
Trait Implementations§
Source§impl Clone for SessionWidget
impl Clone for SessionWidget
Source§fn clone(&self) -> SessionWidget
fn clone(&self) -> SessionWidget
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionWidget
impl Debug for SessionWidget
Auto Trait Implementations§
impl Freeze for SessionWidget
impl RefUnwindSafe for SessionWidget
impl Send for SessionWidget
impl Sync for SessionWidget
impl Unpin for SessionWidget
impl UnwindSafe for SessionWidget
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