pub struct LogElement { /* private fields */ }
Expand description
elements (entries) in the log
Implementations§
Source§impl LogElement
impl LogElement
Sourcepub fn new(title: &str, context: String, time_stamp_on: bool) -> LogElement
pub fn new(title: &str, context: String, time_stamp_on: bool) -> LogElement
creates new LogElement with context as String
§Example
let example = LogElement::new("Test",String::from("Hello, world!", true));
Sourcepub fn new_str(title: &str, context: &str, time_stamp_on: bool) -> LogElement
pub fn new_str(title: &str, context: &str, time_stamp_on: bool) -> LogElement
creates new LogElement with context as &str
§Example
let example = LogElement::new_str("Test","Hello, world!", true);
Sourcepub fn to_string(&self, seperator: &char, start: SystemTime) -> String
pub fn to_string(&self, seperator: &char, start: SystemTime) -> String
converts this struct LogElement
to String
§Example
let example = LogElement::new_str("Test","Hello, world!", true);
println!("{}",example.to_string(':',std::time::SystemTime::now()));
output:
[0:0:25:0] Test : Hello, world!
§Panics
Panics if the SystemTime
is before the UNIX EPOCH.
Trait Implementations§
Source§impl Clone for LogElement
impl Clone for LogElement
Source§fn clone(&self) -> LogElement
fn clone(&self) -> LogElement
Returns a copy 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 LogElement
impl RefUnwindSafe for LogElement
impl Send for LogElement
impl Sync for LogElement
impl Unpin for LogElement
impl UnwindSafe for LogElement
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