Skip to main content

VLog

Trait VLog 

Source
pub trait VLog {
    // Required methods
    fn enabled(&self, metadata: &Metadata<'_>) -> bool;
    fn vlog(&self, record: &Record<'_>);
    fn clear(&self, surface: &str);
    fn flush(&self);
}
Expand description

A trait encapsulating the operations required of a vlogger.

Required Methods§

Source

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Determines if a vlog command with the specified metadata would be vlogged.

This is used by the vlog_enabled! macro to allow callers to avoid expensive computation of vlog message arguments if the message would be discarded anyway.

§For implementors

This method isn’t called automatically by the vlogging macros. It’s up to an implementation of the VLog trait to call enabled in its own vlog method implementation to guarantee that filtering is applied.

Source

fn vlog(&self, record: &Record<'_>)

Draw a point or line in 3D or 2D (ignoring z or using it as z-index).

§For implementors

Note that enabled is not necessarily called before this method. Implementations of vlog should perform all necessary filtering internally.

Source

fn clear(&self, surface: &str)

Clear a drawing surface e.g. to redraw its content.

§For implementors

Note that enabled is called before this method.

Source

fn flush(&self)

Flushes any buffered records.

§For implementors

This method isn’t called automatically by the vlogging macros. It can be called manually on shut-down to ensure any in-flight records are flushed.

Implementations on Foreign Types§

Source§

impl<T> VLog for &T
where T: ?Sized + VLog,

Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Source§

fn vlog(&self, record: &Record<'_>)

Source§

fn clear(&self, surface: &str)

Source§

fn flush(&self)

Source§

impl<T> VLog for Box<T>
where T: ?Sized + VLog,

Available on crate feature std only.
Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Source§

fn vlog(&self, record: &Record<'_>)

Source§

fn clear(&self, surface: &str)

Source§

fn flush(&self)

Source§

impl<T> VLog for Arc<T>
where T: ?Sized + VLog,

Available on crate feature std only.
Source§

fn enabled(&self, metadata: &Metadata<'_>) -> bool

Source§

fn vlog(&self, record: &Record<'_>)

Source§

fn clear(&self, surface: &str)

Source§

fn flush(&self)

Implementors§