Trait dipstick::Buffered

source ·
pub trait Buffered: WithAttributes {
    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§

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: ");
    }
}

Return the current buffering strategy.

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

Implementors§