• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use crate::Connection;
2 
3 use alloc::boxed::Box;
4 
5 impl<E> Connection for Box<dyn Connection<Error = E>> {
6     type Error = E;
7 
read(&mut self) -> Result<u8, Self::Error>8     fn read(&mut self) -> Result<u8, Self::Error> {
9         (**self).read()
10     }
11 
read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error>12     fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Self::Error> {
13         (**self).read_exact(buf)
14     }
15 
write(&mut self, byte: u8) -> Result<(), Self::Error>16     fn write(&mut self, byte: u8) -> Result<(), Self::Error> {
17         (**self).write(byte)
18     }
19 
write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error>20     fn write_all(&mut self, buf: &[u8]) -> Result<(), Self::Error> {
21         (**self).write_all(buf)
22     }
23 
peek(&mut self) -> Result<Option<u8>, Self::Error>24     fn peek(&mut self) -> Result<Option<u8>, Self::Error> {
25         (**self).peek()
26     }
27 
flush(&mut self) -> Result<(), Self::Error>28     fn flush(&mut self) -> Result<(), Self::Error> {
29         (**self).flush()
30     }
31 
on_session_start(&mut self) -> Result<(), Self::Error>32     fn on_session_start(&mut self) -> Result<(), Self::Error> {
33         (**self).on_session_start()
34     }
35 }
36