1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-18 08:31:49 +01:00

add Deref/DerefMut impls for Io

This commit is contained in:
Nikolay Kim 2019-03-12 13:12:22 -07:00
parent 7033b50fed
commit 825117fd4c

View File

@ -111,6 +111,20 @@ impl<T, P> Io<T, P> {
}
}
impl<T, P> std::ops::Deref for Io<T, P> {
type Target = T;
fn deref(&self) -> &T {
&self.io
}
}
impl<T, P> std::ops::DerefMut for Io<T, P> {
fn deref_mut(&mut self) -> &mut T {
&mut self.io
}
}
impl<T: fmt::Debug, P> fmt::Debug for Io<T, P> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Io {{{:?}}}", self.io)