mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-01 00:51:25 +01:00
impl From<S> for bincode::Transport<S>
This commit is contained in:
@@ -118,12 +118,18 @@ where
|
||||
Item: for<'de> Deserialize<'de>,
|
||||
SinkItem: Serialize,
|
||||
{
|
||||
Transport {
|
||||
inner: Compat::new(AsyncBincodeStream::from(io).for_async()),
|
||||
}
|
||||
Transport::from(io)
|
||||
|
||||
}
|
||||
|
||||
impl<S, Item, SinkItem> From<S> for Transport<S, Item, SinkItem> {
|
||||
fn from(inner: S) -> Self {
|
||||
Transport {
|
||||
inner: Compat::new(AsyncBincodeStream::from(inner).for_async()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Connects to `addr`, wrapping the connection in a bincode transport.
|
||||
pub async fn connect<Item, SinkItem>(addr: &SocketAddr) -> io::Result<Transport<TcpStream, Item, SinkItem>>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user