pub enum MessageKind {
Live,
History {
server_message_id: u64,
},
Divider,
LoadMore(LoadMoreDirection),
System,
}Expand description
What a row is.
Note LoadMore and Divider: under xtext both were ordinary text
rows whose meaning was recovered by string-matching the rendered
bytes — chat_history_word_click compared the clicked word against a
composed “↑\u{a0}Load\u{a0}older\u{a0}messages” sentinel, non-breaking
spaces and all, because xtext’s tokenizer splits on ASCII space.
Making them row kinds retires that.
Variants§
Live
A live message from the server.
History
A backfilled message, carrying the server’s message id so the paging cursor can be derived from the buffer rather than tracked alongside it.
Divider
A rule with a caption (“chat history (12 messages)”).
LoadMore(LoadMoreDirection)
The clickable paging row.
System
Client-generated notice — connection state, task errors, /me
output, the old INFOPREFIX lines.
Implementations§
Source§impl MessageKind
impl MessageKind
Sourcepub fn is_history(&self) -> bool
pub fn is_history(&self) -> bool
Part of a chat-history block: backfilled messages and the rows that frame them. These don’t count against the scrollback cap — the user asked for them — and are never trimmed to make room for live rows.