pub struct FmtHandle<W>(/* private fields */);Expand description
A cloneable handle to a single-threaded fmt writer.
Clones of this handle write to the same underlying writer. This type uses interior mutability and is not thread-safe, i.e. it is not Send nor Sync.
§Example
use std::fmt::Write;
use nu_utils::FmtHandle;
let mut string = String::new();
let mut a = FmtHandle::new(&mut string);
let mut b = a.clone();
a.write_str("abc").unwrap();
b.write_str("def").unwrap();
drop(a);
drop(b);
assert_eq!(string, "abcdef");Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<W> !RefUnwindSafe for FmtHandle<W>
impl<W> !Send for FmtHandle<W>
impl<W> !Sync for FmtHandle<W>
impl<W> !UnwindSafe for FmtHandle<W>
impl<W> Freeze for FmtHandle<W>
impl<W> Unpin for FmtHandle<W>
impl<W> UnsafeUnpin for FmtHandle<W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more