Trait anstream::Lockable

source ·
pub trait Lockable {
    type Locked;

    fn lock(self) -> Self::Locked;
}
Expand description

Explicitly lock a std::io::Writeable

Required Associated Types§

Required Methods§

Get exclusive access to the AutoStream

Why?

  • Faster performance when writing in a loop
  • Avoid other threads interleaving output with the current thread

Implementations on Foreign Types§

Implementors§