Struct saito_rust::peer::OutboundPeer [−][src]
pub struct OutboundPeer {
pub write_sink: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>,
}
Expand description
An outbound Peer. This holds a Stream(Sender/Sink) for a peer which we have connected to via /wsopen. TODO: Unify InboundPeer and OutboundPeer into a single trait and perhaps integrate it into SaitoPeer. This has proven to be a very difficult task because of ownership loops that make it very tricky to interact with a peer by reading messages from a socket which is inside the peer. This is why we have a separate structure to hold the sockets vs the rest of the peer data. It may be easy to at least unify Inbound and Outbound into a single Trait though and merge InboundPeersDB and OutboundPeersDB
Fields
write_sink: SplitSink<WebSocketStream<MaybeTlsStream<TcpStream>>, Message>
Auto Trait Implementations
impl !RefUnwindSafe for OutboundPeer
impl Send for OutboundPeer
impl Sync for OutboundPeer
impl Unpin for OutboundPeer
impl !UnwindSafe for OutboundPeer
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more