pub struct SessionIndex {
pub sessions: Vec<SessionMetadata>,
pub last_session_id: Option<String>,
}Expand description
Index of all sessions, stored in ~/.matrix/sessions/index.json
Fields§
§sessions: Vec<SessionMetadata>All known sessions.
last_session_id: Option<String>ID of the most recently active session (for –continue).
Implementations§
Source§impl SessionIndex
impl SessionIndex
Sourcepub fn find(&self, query: &str) -> Option<&SessionMetadata>
pub fn find(&self, query: &str) -> Option<&SessionMetadata>
Find a session by ID or name.
Sourcepub fn last_session(&self) -> Option<&SessionMetadata>
pub fn last_session(&self) -> Option<&SessionMetadata>
Get the last session (for –continue).
Sourcepub fn upsert(&mut self, meta: SessionMetadata)
pub fn upsert(&mut self, meta: SessionMetadata)
Add or update a session in the index.
Sourcepub fn remove(&mut self, id: &str) -> Option<SessionMetadata>
pub fn remove(&mut self, id: &str) -> Option<SessionMetadata>
Remove a session from the index.
Trait Implementations§
Source§impl Clone for SessionIndex
impl Clone for SessionIndex
Source§fn clone(&self) -> SessionIndex
fn clone(&self) -> SessionIndex
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 moreSource§impl Debug for SessionIndex
impl Debug for SessionIndex
Source§impl Default for SessionIndex
impl Default for SessionIndex
Source§fn default() -> SessionIndex
fn default() -> SessionIndex
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SessionIndex
impl<'de> Deserialize<'de> for SessionIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SessionIndex
impl RefUnwindSafe for SessionIndex
impl Send for SessionIndex
impl Sync for SessionIndex
impl Unpin for SessionIndex
impl UnsafeUnpin for SessionIndex
impl UnwindSafe for SessionIndex
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