pub struct MessagesRepo<'a> { /* private fields */ }Implementations§
Source§impl MessagesRepo<'_>
impl MessagesRepo<'_>
pub fn add(&self, new: NewMessage) -> Result<MessageRecord>
pub fn get(&self, id: i64) -> Result<Option<MessageRecord>>
Sourcepub fn list_for_session(&self, session_id: &str) -> Result<Vec<MessageRecord>>
pub fn list_for_session(&self, session_id: &str) -> Result<Vec<MessageRecord>>
Load a session’s messages in chronological order, capped at
[MAX_SESSION_MESSAGES] (F24/RC-F).
A session transcript is otherwise unbounded, and the daemon
session_messages path loads it whole into RAM — a pathological session
could OOM the daemon. We return the most recent MAX_SESSION_MESSAGES
(newest activity is what a viewer wants) but still in ascending id
order, by taking the tail in a subquery and re-sorting it ascending.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MessagesRepo<'a>
impl<'a> !Send for MessagesRepo<'a>
impl<'a> !Sync for MessagesRepo<'a>
impl<'a> !UnwindSafe for MessagesRepo<'a>
impl<'a> Freeze for MessagesRepo<'a>
impl<'a> Unpin for MessagesRepo<'a>
impl<'a> UnsafeUnpin for MessagesRepo<'a>
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