pub enum Stream {
Unix(UnixStream),
Tcp(TcpStream),
NamedPipe(OsString),
}Expand description
Client service connection.
This structure contains an already open stream. Note that the streams are set to non-blocking mode.
§Examples
let binding: Binding = "tcp://127.0.0.1:8080".parse()?;
let stream = binding.try_into()?;
assert!(matches!(stream, Stream::Tcp(_)));Variants§
Unix(UnixStream)
Stream for a Unix domain socket.
Tcp(TcpStream)
Stream for a TCP socket.
NamedPipe(OsString)
Named Pipe.
Trait Implementations§
Source§impl From<UnixStream> for Stream
Available on Unix only.
impl From<UnixStream> for Stream
Available on Unix only.
Source§fn from(stream: UnixStream) -> Self
fn from(stream: UnixStream) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Stream
impl RefUnwindSafe for Stream
impl Send for Stream
impl Sync for Stream
impl Unpin for Stream
impl UnwindSafe for Stream
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