pub struct IntervalLogWriterBuilder { /* private fields */ }
Expand description

Prepare an IntervalLogWriter.

This type only allows writing comments and headers. Once you’re done writing those things, use into_log_writer() to convert this into an IntervalLogWriter.

Implementations§

source§

impl IntervalLogWriterBuilder

source

pub fn new() -> IntervalLogWriterBuilder

Create a new log writer that writes to writer and serializes histograms with serializer.

source

pub fn add_comment(&mut self, s: &str) -> &mut Self

Add a comment line to be written when the writer is built.

Comments containing ‘\n’ will be transformed into multiple lines of comments.

source

pub fn with_start_time(&mut self, time: SystemTime) -> &mut Self

Set a StartTime. See the module-level documentation for more info.

This can be called multiple times, but only the value for the most recent invocation will be written.

source

pub fn with_base_time(&mut self, time: SystemTime) -> &mut Self

Set a BaseTime. See the module-level documentation for more info.

This can be called multiple times, but only the value for the most recent invocation will be written.

source

pub fn with_max_value_divisor(&mut self, max_value_divisor: f64) -> &mut Self

Set a max value divisor.

This is used to scale down the max value part of an interval log to something that may be more human readable. The max value in the log is only for human consumption, so you might prefer to divide by 109 to turn nanoseconds into fractional seconds, for instance.

If this is not set, 1.0 will be used.

This can be called multiple times, but only the value for the most recent invocation will be written.

source

pub fn begin_log_with<'a, 'b, W: 'a + Write, S: 'b + Serializer>( &self, writer: &'a mut W, serializer: &'b mut S ) -> Result<IntervalLogWriter<'a, 'b, W, S>, Error>

Build a LogWriter and apply any configured headers.

Trait Implementations§

source§

impl Default for IntervalLogWriterBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.