pub struct MessagePage {
pub messages: Vec<Message>,
pub next_cursor: Option<String>,
pub total: u32,
}Expand description
One page of the record, newest first.
Fields§
§messages: Vec<Message>The page’s messages, messages[0] being the most recently appended
one. Every message carries the id and inserted-by its record line
holds, and a message whose role is "tool" carries the envelope
this interface’s doc describes.
next_cursor: Option<String>Cursor for the next (older) page, or none when this page reached
the oldest message in the record.
total: u32Parseable messages in the whole record at the moment this page was served, not in this page. A record line that is not a message is skipped and not counted.
A snapshot, not a loop invariant: the runtime appends while a hook
pages, so total can grow from one page to the next and the page
lengths of a completed walk can sum to less than the final total.
Every page is a consistent snapshot anchored at the oldest message,
so nothing repeats and nothing is skipped; a loop is sized by
next-cursor: none, which is the only correct termination
condition.
Trait Implementations§
Source§impl Clone for MessagePage
impl Clone for MessagePage
impl ComponentType for MessagePage
Source§impl Debug for MessagePage
impl Debug for MessagePage
Source§impl<'de> Deserialize<'de> for MessagePage
impl<'de> Deserialize<'de> for MessagePage
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>,
impl Lift for MessagePage
impl Lower for MessagePage
Auto Trait Implementations§
impl Forget for MessagePage
impl Freeze for MessagePage
impl Move for MessagePage
impl RefUnwindSafe for MessagePage
impl Send for MessagePage
impl Sync for MessagePage
impl Unpin for MessagePage
impl UnsafeUnpin for MessagePage
impl UnwindSafe for MessagePage
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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