Trait dipstick::Buffered

source ·
pub trait Buffered: WithAttributes {
    // Provided methods
    fn buffered(&self, buffering: Buffering) -> Self { ... }
    fn get_buffering(&self) -> Buffering { ... }
    fn is_buffered(&self) -> bool { ... }
}
Expand description

Determine scope buffering strategy, if supported by output. Changing this only affects scopes opened afterwards. Buffering is done on best effort, meaning flush will occur if buffer capacity is exceeded.

Provided Methods§

source

fn buffered(&self, buffering: Buffering) -> Self

Return a clone with the specified buffering set.

Examples found in repository?
examples/buffered_flush_on_drop.rs (line 9)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fn main() {
    let input = Stream::write_to_stdout().buffered(Buffering::Unlimited);

    loop {
        println!("\n------- open scope");

        let metrics = input.metrics();

        metrics.marker("marker_a").mark();

        sleep(Duration::from_millis(1000));

        println!("------- close scope: ");
    }
}
source

fn get_buffering(&self) -> Buffering

Return the current buffering strategy.

source

fn is_buffered(&self) -> bool

Returns false if the current buffering strategy is Buffering::Unbuffered. Returns true otherwise.

Object Safety§

This trait is not object safe.

Implementors§