pub struct Message { /* private fields */ }
Expand description
A Message represents a MessageDestination
independent way to send a message to a platform.
However - not every destination will support every type of formatting, or may have length / size
restrictions - so be aware of this. Destinations should do their best to receive the message, even if they
have to ignore formatting to do so.
To construct a Message, consider using MessageBuilder
or MessageDetailBuilder
to make
your life easier.
§Parts of a Message
- Level - Severity of message
- Title - Optional, short snappy summary of what the message is about
- MessageDetail - Structured body text supporting formatting
- Component - Optional, indicating what the message is about, e.g a program or server.
- Author - Who created the message
- Timestamp - The unix timestamp in milliseconds, showing when the message was sent.
Implementations§
Source§impl Message
impl Message
pub fn new( level: Level, title: Option<String>, message_detail: MessageDetail, component: Option<Component>, author: Author, unix_timestamp_millis: i64, ) -> Self
pub fn get_level(&self) -> &Level
pub fn get_title(&self) -> &Option<String>
pub fn get_message_detail(&self) -> &MessageDetail
pub fn get_unix_timestamp_millis(&self) -> i64
pub fn get_component(&self) -> &Option<Component>
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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
Mutably borrows from an owned value. Read more