pub enum NetworkStream {
Raw {
peer_addr: SocketAddr,
local_addr: SocketAddr,
stream: TcpStream,
},
TlsServer {
peer_addr: SocketAddr,
local_addr: SocketAddr,
stream: TlsStream<TcpStream>,
},
TlsClient {
peer_addr: SocketAddr,
local_addr: SocketAddr,
stream: TlsStream<TcpStream>,
},
External {
peer_label: Option<String>,
local_label: Option<String>,
reader: BoxRead,
writer: BoxWrite,
},
}Expand description
A network data stream which can either be
- unencrypted
- encrypted and the server-side of the session
- encrypted and the client-side of the session
Variants§
Raw
Unencrypted session
TlsServer
Encrypted as the server-side of the session
TlsClient
Encrypted as the client-side of the session
External
External transport injected by the user
This variant enables custom transports to be used while preserving the existing TCP/TLS paths. The provided reader/writer must be a connected, bidirectional byte stream using the same framing (u64/usize big-endian length prefix + prost payload).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NetworkStream
impl !RefUnwindSafe for NetworkStream
impl Send for NetworkStream
impl !Sync for NetworkStream
impl Unpin for NetworkStream
impl !UnwindSafe for NetworkStream
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