tari_log4rs/encode/writer/
simple.rs1use crate::encode;
6use std::{fmt, io};
7
8#[derive(Clone, Eq, PartialEq, Hash, Debug)]
11pub struct SimpleWriter<W>(pub W);
12
13impl<W: io::Write> io::Write for SimpleWriter<W> {
14 fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
15 self.0.write(buf)
16 }
17
18 fn flush(&mut self) -> io::Result<()> {
19 self.0.flush()
20 }
21
22 fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
23 self.0.write_all(buf)
24 }
25
26 fn write_fmt(&mut self, fmt: fmt::Arguments) -> io::Result<()> {
27 self.0.write_fmt(fmt)
28 }
29}
30
31impl<W: io::Write> encode::Write for SimpleWriter<W> {}