Reader, Writer.into_inner().
This commit is contained in:
parent
1fb8c16cc3
commit
b67502adce
1 changed files with 8 additions and 0 deletions
|
@ -66,6 +66,10 @@ impl<W: Write> Sender<W> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn into_inner(self) -> W {
|
||||
self.w
|
||||
}
|
||||
|
||||
pub fn send(&mut self, f: &[u8]) -> Result<()> {
|
||||
let mut code = cobs::encode_vec(f);
|
||||
code.push(FRAME_END);
|
||||
|
@ -95,6 +99,10 @@ impl<R: Read> Receiver<R> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn into_inner(self) -> R {
|
||||
self.r
|
||||
}
|
||||
|
||||
pub fn recv(&mut self) -> Result<Vec<u8>> {
|
||||
let mut next_frame = Vec::new();
|
||||
|
||||
|
|
Loading…
Reference in a new issue