pub enum ChatPersist {
New(Message),
Updated {
message: Message,
edit_event: Option<Box<StoredEvent>>,
},
Removed(String),
ReactionRemoved {
reaction_id: String,
message: Message,
},
}Expand description
What applying a v2 chat event to STATE yielded — the caller persists it (async)
once the STATE lock is dropped. Mirrors v1’s IncomingEvent for the chat sub-kinds:
a message row is saved fresh or re-saved (a landed reaction rides the row), a delete
drops it. Persistence is the caller’s so the apply step stays sync + lock-scoped.
Variants§
New(Message)
A brand-new message — save its row.
Updated
A message changed: a reaction landed (edit_event None → re-save the row, which
carries reactions) or an edit applied (edit_event Some → save the folded
MESSAGE_EDIT event, event-sourced like v1 + DMs, never a row overwrite).
Removed(String)
A message removed by its author — drop its row.
ReactionRemoved
A reaction revoked by its reactor — drop the kind-7 row (save is additive; a lingering row would resurrect the chip on the next load) and re-save the parent so its embedded reactions refresh.
Auto Trait Implementations§
impl Freeze for ChatPersist
impl RefUnwindSafe for ChatPersist
impl Send for ChatPersist
impl Sync for ChatPersist
impl Unpin for ChatPersist
impl UnsafeUnpin for ChatPersist
impl UnwindSafe for ChatPersist
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> 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