pub struct RealtimeLogger { /* private fields */ }Expand description
A helper used for realtime-safe logging on the audio thread.
Implementations§
Source§impl RealtimeLogger
impl RealtimeLogger
Sourcepub fn max_message_length(&self) -> usize
pub fn max_message_length(&self) -> usize
The allocated capacity for each message slot.
Sourcepub fn available_debug_slots(&self) -> usize
pub fn available_debug_slots(&self) -> usize
Returns the number of slots that are available for debug messages.
This will always return 0 when compiled without debug assertions.
Sourcepub fn available_error_slots(&self) -> usize
pub fn available_error_slots(&self) -> usize
Returns the number of slots that are available for error messages.
Sourcepub fn try_debug(&mut self, message: &str) -> Result<(), RealtimeLogError>
pub fn try_debug(&mut self, message: &str) -> Result<(), RealtimeLogError>
Log the given debug message.
NOTE, avoid using this method in the final release of your node. This is only meant for debugging purposes while developing.
This will do nothing when compiled without debug assertions.
Sourcepub fn try_debug_with(
&mut self,
f: impl FnOnce(&mut String),
) -> Result<(), RealtimeLogError>
pub fn try_debug_with( &mut self, f: impl FnOnce(&mut String), ) -> Result<(), RealtimeLogError>
Log a debug message into the given string.
This string is gauranteed to be empty and have an allocated capacity
of at least RealtimeLogger::max_message_length.
NOTE, avoid using this method in the final release of your node. This is only meant for debugging purposes while developing.
This will do nothing when compiled without debug assertions.
Sourcepub fn try_error(&mut self, message: &str) -> Result<(), RealtimeLogError>
pub fn try_error(&mut self, message: &str) -> Result<(), RealtimeLogError>
Log the given error message.
Sourcepub fn try_error_with(
&mut self,
f: impl FnOnce(&mut String),
) -> Result<(), RealtimeLogError>
pub fn try_error_with( &mut self, f: impl FnOnce(&mut String), ) -> Result<(), RealtimeLogError>
Log an error message into the given string.
This string is gauranteed to be empty and have an allocated capacity
of at least RealtimeLogger::max_message_length.
Auto Trait Implementations§
impl !Freeze for RealtimeLogger
impl !RefUnwindSafe for RealtimeLogger
impl Send for RealtimeLogger
impl !Sync for RealtimeLogger
impl Unpin for RealtimeLogger
impl UnwindSafe for RealtimeLogger
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.