pub struct AuthoredMessage {
pub author: String,
pub contents: NodeContents,
pub time_sent: String,
pub index: String,
}
Expand description
A Message
with the author @p, post time and index also included
Fields§
§contents: NodeContents
§time_sent: String
§index: String
Implementations§
Source§impl AuthoredMessage
impl AuthoredMessage
Sourcepub fn new(
author: &str,
contents: &NodeContents,
time_sent: &str,
index: &str,
) -> AuthoredMessage
pub fn new( author: &str, contents: &NodeContents, time_sent: &str, index: &str, ) -> AuthoredMessage
Create a new AuthoredMessage
Sourcepub fn from_node(node: &Node) -> AuthoredMessage
pub fn from_node(node: &Node) -> AuthoredMessage
Parses a Node
into Self
Sourcepub fn to_formatted_string(&self) -> String
pub fn to_formatted_string(&self) -> String
Converts self into a human readable formatted string which includes the author, date, and node contents.
Trait Implementations§
Source§impl Clone for AuthoredMessage
impl Clone for AuthoredMessage
Source§fn clone(&self) -> AuthoredMessage
fn clone(&self) -> AuthoredMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AuthoredMessage
impl RefUnwindSafe for AuthoredMessage
impl Send for AuthoredMessage
impl Sync for AuthoredMessage
impl Unpin for AuthoredMessage
impl UnwindSafe for AuthoredMessage
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