Impl io::Write for helpers::FileLock

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-07-26 22:39:15 +10:00
parent 172af54cd8
commit 46c4d6f406
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -43,3 +43,16 @@ impl ops::DerefMut for FileLock {
&mut self.0 &mut self.0
} }
} }
impl io::Write for FileLock {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
fn flush(&mut self) -> io::Result<()> {
self.0.flush()
}
fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result<usize> {
self.0.write_vectored(bufs)
}
}