Make new ChatMsg trait for Chat message rendering

This commit is contained in:
Joscha 2022-08-01 19:57:05 +02:00
parent 5c9c6e9d98
commit 4ac0b5f074
13 changed files with 122 additions and 69 deletions

View file

@ -4,18 +4,12 @@ use std::hash::Hash;
use std::vec;
use async_trait::async_trait;
use time::OffsetDateTime;
use toss::styled::Styled;
pub trait Msg {
type Id: Clone + Debug + Hash + Eq + Ord;
fn id(&self) -> Self::Id;
fn parent(&self) -> Option<Self::Id>;
fn time(&self) -> OffsetDateTime;
fn nick(&self) -> Styled;
fn content(&self) -> Styled;
fn last_possible_id() -> Self::Id;
}