pub struct SessionCache {
pub entries: Vec<SessionEntry>,
pub summaries: Vec<String>,
}Expand description
In-memory cache for the /sessions group.
Fields§
§entries: Vec<SessionEntry>§summaries: Vec<String>Implementations§
Source§impl SessionCache
impl SessionCache
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn add(
&mut self,
id: &str,
start_idx: usize,
end_idx: usize,
channel: &str,
summary: &str,
)
pub fn add( &mut self, id: &str, start_idx: usize, end_idx: usize, channel: &str, summary: &str, )
Add a new session with its summary.
Sourcepub fn latest_session_id(&self) -> Option<&str>
pub fn latest_session_id(&self) -> Option<&str>
Return the ID of the most recently added session, if any.
Sourcepub fn find_summary(&self, session_id: &str) -> Option<&str>
pub fn find_summary(&self, session_id: &str) -> Option<&str>
Find the summary for a session by ID.
Trait Implementations§
Source§impl Clone for SessionCache
impl Clone for SessionCache
Source§fn clone(&self) -> SessionCache
fn clone(&self) -> SessionCache
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 SessionCache
impl Debug for SessionCache
Auto Trait Implementations§
impl Freeze for SessionCache
impl RefUnwindSafe for SessionCache
impl Send for SessionCache
impl Sync for SessionCache
impl Unpin for SessionCache
impl UnsafeUnpin for SessionCache
impl UnwindSafe for SessionCache
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> 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