pub struct Summary {
pub prefix: Option<SummaryPrefix>,
pub text: String,
pub timestamp: i64,
pub state: MessageState,
pub thumbnail_path: Option<String>,
}
Expand description
Message summary.
Fields§
§prefix: Option<SummaryPrefix>
Part displayed before “:”, such as an username or a string “Draft”.
text: String
Summary text, always present.
timestamp: i64
Message timestamp.
state: MessageState
Message state.
thumbnail_path: Option<String>
Message preview image path
Implementations§
source§impl Summary
impl Summary
sourcepub async fn new_with_reaction_details(
context: &Context,
msg: &Message,
chat: &Chat,
contact: Option<&Contact>,
) -> Result<Summary>
pub async fn new_with_reaction_details( context: &Context, msg: &Message, chat: &Chat, contact: Option<&Contact>, ) -> Result<Summary>
Constructs chatlist summary from the provided message, chat and message author contact snapshots.
sourcepub async fn new(
context: &Context,
msg: &Message,
chat: &Chat,
contact: Option<&Contact>,
) -> Result<Summary>
pub async fn new( context: &Context, msg: &Message, chat: &Chat, contact: Option<&Contact>, ) -> Result<Summary>
Constructs search result summary from the provided message, chat and message author contact snapshots.
sourcepub fn truncated_text(&self, approx_chars: usize) -> Cow<'_, str>
pub fn truncated_text(&self, approx_chars: usize) -> Cow<'_, str>
Returns the Summary::text
attribute truncated to an approximate length.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Summary
impl RefUnwindSafe for Summary
impl Send for Summary
impl Sync for Summary
impl Unpin for Summary
impl UnwindSafe for Summary
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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