mirror of
https://github.com/fafhrd91/actix-net
synced 2025-01-30 09:22:52 +01:00
add Deref/DerefMut impls for Io
This commit is contained in:
parent
7033b50fed
commit
825117fd4c
@ -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> {
|
impl<T: fmt::Debug, P> fmt::Debug for Io<T, P> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "Io {{{:?}}}", self.io)
|
write!(f, "Io {{{:?}}}", self.io)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user