pub struct NetworkHandle {
pub sockaddr: SocketAddr,
pub chainsync: Channel<ChainSync>,
pub txsubmit: Channel<TxSubmit>,
pub blockfetch: Channel<BlockFetch>,
pub stats: StreamStatsShared,
/* private fields */
}
Fields§
§sockaddr: SocketAddr
the socket address of the opposite side
chainsync: Channel<ChainSync>
chainsync sub protocol
txsubmit: Channel<TxSubmit>
txsubmit sub protocol
blockfetch: Channel<BlockFetch>
blockfetch sub protocol
stats: StreamStatsShared
Stats for the stream
Implementations§
Source§impl NetworkHandle
impl NetworkHandle
Sourcepub async fn start(
network_description: &NetworkDescription,
) -> Result<NetworkHandle, NetworkError>
pub async fn start( network_description: &NetworkDescription, ) -> Result<NetworkHandle, NetworkError>
Connect to the network with the expected parameters, perform the protocol handshake and in the background wait for packet to send and receive.
pub async fn stop(self)
Auto Trait Implementations§
impl Freeze for NetworkHandle
impl RefUnwindSafe for NetworkHandle
impl Send for NetworkHandle
impl Sync for NetworkHandle
impl Unpin for NetworkHandle
impl UnwindSafe for NetworkHandle
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