mirror of
https://github.com/actix/actix-extras.git
synced 2025-08-21 15:55:36 +02:00
Add Debug impl for BoxedSocket
This commit is contained in:
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
* Do not set any default headers
|
* Do not set any default headers
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add Debug impl for BoxedSocket
|
||||||
|
|
||||||
|
|
||||||
## [0.1.0-alpha.4] - 2019-04-08
|
## [0.1.0-alpha.4] - 2019-04-08
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
use std::io;
|
use std::{fmt, io};
|
||||||
|
|
||||||
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
||||||
use actix_http::body::Body;
|
use actix_http::body::Body;
|
||||||
@@ -102,6 +102,12 @@ impl<T: AsyncRead + AsyncWrite> AsyncSocket for Socket<T> {
|
|||||||
|
|
||||||
pub struct BoxedSocket(Box<dyn AsyncSocket>);
|
pub struct BoxedSocket(Box<dyn AsyncSocket>);
|
||||||
|
|
||||||
|
impl fmt::Debug for BoxedSocket {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
write!(f, "BoxedSocket")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl io::Read for BoxedSocket {
|
impl io::Read for BoxedSocket {
|
||||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||||
self.0.as_read_mut().read(buf)
|
self.0.as_read_mut().read(buf)
|
||||||
|
Reference in New Issue
Block a user