pub struct Logger<Targ, Time>{
pub targets: Targ,
pub start: Time,
}Expand description
Logger
TODO: The fields of this struct are public only because generics on const fns are unstable.
Fields§
§targets: Targ§start: TimeImplementations§
Source§impl<Targ, Time> Logger<Targ, Time>
impl<Targ, Time> Logger<Targ, Time>
Sourcepub fn new(targets: Targ, start: Time) -> Self
pub fn new(targets: Targ, start: Time) -> Self
Creates a new Logger.
TODO: This function should be const but that is unstable with generic parameters, thus the fields of the logger are made public instead.
Sourcepub fn start_mut(&mut self) -> &mut Time
pub fn start_mut(&mut self) -> &mut Time
Returns a mutable reference to the start field.
This can be used to have a static mut logger and change the start at the beginning of the program.
pub fn init_boxed(self) -> Result<(), SetLoggerError>
pub fn init_static(&'static self) -> Result<(), SetLoggerError>
pub unsafe fn init_static_racy(&'static self) -> Result<(), SetLoggerError>
Trait Implementations§
Auto Trait Implementations§
impl<Targ, Time> Freeze for Logger<Targ, Time>
impl<Targ, Time> RefUnwindSafe for Logger<Targ, Time>where
Targ: RefUnwindSafe,
Time: RefUnwindSafe,
impl<Targ, Time> Send for Logger<Targ, Time>
impl<Targ, Time> Sync for Logger<Targ, Time>
impl<Targ, Time> Unpin for Logger<Targ, Time>
impl<Targ, Time> UnwindSafe for Logger<Targ, Time>where
Targ: UnwindSafe,
Time: UnwindSafe,
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