Skip to main content

NodeClientStream

Trait NodeClientStream 

Source
pub trait NodeClientStream:
    AsyncRead
    + AsyncWrite
    + Unpin
    + Send { }
Expand description

Any byte stream this wire’s CLIENT side can run on.

Public so a caller can hand in a stream it established itself. The handshake never cared what carried it – it reads and writes framed JSON – but until LocalNodeClient::adopt existed the only way in was through a constructor that also opened the connection, which welded “who dials” to “who is the protocol client”. Those are separate questions: a node behind NAT must dial out, and must still be the protocol’s server when it gets there.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§