pub struct SessionHistory {
pub entries: Vec<HistoryEntry>,
}Fields§
§entries: Vec<HistoryEntry>Implementations§
Source§impl SessionHistory
impl SessionHistory
pub fn new() -> Self
pub fn history_file() -> Result<PathBuf>
pub fn load() -> Result<Self>
pub fn save(&self) -> Result<()>
pub fn add_entry(&mut self, entry: HistoryEntry) -> Result<()>
pub fn record_session_created(session: &Session) -> Result<()>
pub fn record_session_attached(session: &Session) -> Result<()>
pub fn record_session_detached(session: &Session) -> Result<()>
pub fn record_session_killed(session: &Session) -> Result<()>
pub fn record_session_crashed(session: &Session) -> Result<()>
pub fn record_session_renamed( session: &Session, old_name: Option<String>, new_name: String, ) -> Result<()>
pub fn get_session_history(&self, session_id: &str) -> Vec<&HistoryEntry>
pub fn get_all_sessions(&self) -> Vec<String>
pub fn format_duration(seconds: i64) -> String
Trait Implementations§
Source§impl Debug for SessionHistory
impl Debug for SessionHistory
Source§impl<'de> Deserialize<'de> for SessionHistory
impl<'de> Deserialize<'de> for SessionHistory
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 SessionHistory
impl RefUnwindSafe for SessionHistory
impl Send for SessionHistory
impl Sync for SessionHistory
impl Unpin for SessionHistory
impl UnwindSafe for SessionHistory
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> 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