Struct fizyr_rpc::transport::StreamTransport
source · pub struct StreamTransport<Stream> { /* private fields */ }
Expand description
Transport layer for byte-stream sockets.
Implementations§
source§impl<Stream> StreamTransport<Stream>where
Self: Transport,
impl<Stream> StreamTransport<Stream>where
Self: Transport,
sourcepub fn new(stream: Stream, config: StreamConfig) -> Self
pub fn new(stream: Stream, config: StreamConfig) -> Self
Create a new transport with custom configuration.
sourcepub fn new_default(stream: Stream) -> Self
pub fn new_default(stream: Stream) -> Self
Create a new transport using the default configuration.
sourcepub fn stream_mut(&mut self) -> &Stream
pub fn stream_mut(&mut self) -> &Stream
Get direct mutable access to the underlying stream.
sourcepub fn into_stream(self) -> Stream
pub fn into_stream(self) -> Stream
Consume the stream transport to retrieve the underlying stream.
Trait Implementations§
source§impl<'a, Address> Connect<'a, Address> for StreamTransport<TcpStream>where
Address: ToSocketAddrs + 'a,
impl<'a, Address> Connect<'a, Address> for StreamTransport<TcpStream>where
Address: ToSocketAddrs + 'a,
source§impl<'a, Address> Connect<'a, Address> for StreamTransport<UnixStream>
impl<'a, Address> Connect<'a, Address> for StreamTransport<UnixStream>
source§impl Transport for StreamTransport<TcpStream>
impl Transport for StreamTransport<TcpStream>
§type Body = StreamBody
type Body = StreamBody
The body type for the messages.
§type Info = TcpStreamInfo
type Info = TcpStreamInfo
Information about the underlying stream or connection of the transport.
§type Config = StreamConfig
type Config = StreamConfig
The configuration type for the transport.
source§impl Transport for StreamTransport<UnixStream>
impl Transport for StreamTransport<UnixStream>
§type Body = StreamBody
type Body = StreamBody
The body type for the messages.
§type Info = UnixStreamInfo
type Info = UnixStreamInfo
Information about the underlying stream or connection of the transport.
§type Config = StreamConfig
type Config = StreamConfig
The configuration type for the transport.
Auto Trait Implementations§
impl<Stream> RefUnwindSafe for StreamTransport<Stream>where
Stream: RefUnwindSafe,
impl<Stream> Send for StreamTransport<Stream>where
Stream: Send,
impl<Stream> Sync for StreamTransport<Stream>where
Stream: Sync,
impl<Stream> Unpin for StreamTransport<Stream>where
Stream: Unpin,
impl<Stream> UnwindSafe for StreamTransport<Stream>where
Stream: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more