chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3cf116
)
packetframe: Provide Write impl for Fuse
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 15 Apr 2021 01:01:35 +0000
(
02:01
+0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 23 Apr 2021 18:32:07 +0000
(19:32 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/packetframe.rs
patch
|
blob
|
history
diff --git
a/src/packetframe.rs
b/src/packetframe.rs
index 920916a821c70d065a6aa15ff67520d90387669f..46007997c1c7e7b0145d5adfe211dee6d98aefdb 100644
(file)
--- a/
src/packetframe.rs
+++ b/
src/packetframe.rs
@@
-72,6
+72,16
@@
impl<R:Read> Read for Fuse<R> {
self.with(|inner| inner.read(buf))?
}
}
+impl<W:Write> Write for Fuse<W> {
+ #[throws(io::Error)]
+ fn write(&mut self, buf: &[u8]) -> usize {
+ self.with(|inner| inner.write(buf))?
+ }
+ #[throws(io::Error)]
+ fn flush(&mut self) {
+ self.with(|inner| inner.flush())?
+ }
+}
impl From<Broken> for io::Error {
fn from(broken: Broken) -> io::Error {