File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ pub mod default;
88
99pub use default:: DefaultMakeCodec ;
1010
11- /// [`Decoder`] reads from an [`AsyncRead`] and decodes the data into a [`ThriftMessage`].
11+ /// [`Decoder`] decodes the data into a [`ThriftMessage`].
1212///
1313/// Returning an Ok(None) indicates the EOF has been reached.
1414///
@@ -24,7 +24,7 @@ pub trait Decoder: Send + Sync + 'static {
2424 }
2525}
2626
27- /// [`Encoder`] writes a [`ThriftMessage`] to an [`AsyncWrite`] and flushes the data.
27+ /// [`Encoder`] writes a [`ThriftMessage`] and flushes the data.
2828///
2929/// Note: [`Encoder`] should be designed to be ready for reuse.
3030pub trait Encoder : Send + Sync + ' static {
@@ -39,8 +39,7 @@ pub trait Encoder: Send + Sync + 'static {
3939 }
4040}
4141
42- /// [`MakeCodec`] receives an [`R`] and an [`W`] and returns a
43- /// [`Decoder`] and an [`Encoder`].
42+ /// [`MakeCodec`] returns a [`Decoder`] and an [`Encoder`].
4443///
4544/// The implementation of [`MakeCodec`] must make sure the [`Decoder`] and [`Encoder`]
4645/// matches.
Original file line number Diff line number Diff line change 1+ #[ cfg( target_family = "unix" ) ]
2+ use std:: os:: fd:: { AsRawFd , RawFd } ;
13use std:: {
24 io,
3- os:: fd:: { AsRawFd , RawFd } ,
45 pin:: Pin ,
56 task:: { Context , Poll } ,
67} ;
@@ -367,12 +368,12 @@ impl ConnStream {
367368 }
368369}
369370
371+ #[ cfg( target_family = "unix" ) ]
370372impl AsRawFd for ConnStream {
371373 #[ inline]
372374 fn as_raw_fd ( & self ) -> RawFd {
373375 match self {
374376 Self :: Tcp ( s) => s. as_raw_fd ( ) ,
375- #[ cfg( target_family = "unix" ) ]
376377 Self :: Unix ( s) => s. as_raw_fd ( ) ,
377378 #[ cfg( feature = "rustls" ) ]
378379 Self :: Rustls ( s) => s. as_raw_fd ( ) ,
You can’t perform that action at this time.
0 commit comments