pub struct Shard { /* private fields */ }
Expand description

P2P messages distribution layer

Implementations

Configuration

Instant metrics

Short overlay id

Returns local ADNL key for public overlay

Verifies and adds new peer to the overlay. Returns Some short peer id if new peer was successfully added and None if peer already existed.

See Shard::add_public_peers for multiple peers.

Verifies and adds new peers to the overlay. Returns a list of successfully added peers.

See Shard::add_public_peer for single peer.

Removes peer from random peers and adds it to ignored peers

Fill dst with amount peers from known peers

Serialized proto::rpc::OverlayQuery with own overlay id

Serialized proto::overlay::Message with own overlay id

Sends direct ADNL message (proto::adnl::Message::Custom) to the given peer.

NOTE: Local id (Shard::overlay_key) will be used as sender

Sends ADNL query directly to the given peer. In case of timeout returns Ok(None)

NOTE: Local id (Shard::overlay_key) will be used as sender

Sends RLDP query directly to the given peer. In case of timeout returns Ok((None, max_timeout))

NOTE: Local id (Shard::overlay_key) will be used as sender

Distributes provided message to the neighbours subset.

See broadcast_target_count in ShardOptions

NOTE: If data len is greater than

Waits until the next received broadcast.

NOTE: It is important to keep polling this method because otherwise received broadcasts queue will consume all the memory.

Take received peers map

Returns raw signed overlay node

Exchanges random peers with the specified peer. Returns Ok(None) in case of timeout

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the indexed conversion.

Should always be Self

Consumes the current HList and returns an HList with the requested shape. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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