Skip to main content

Module prelude

Module prelude 

Source
Expand description

A prelude is provided which imports all the important data types and traits of ring-network.

Re-exports§

pub use rings_core;
pub use self::rings_core::prelude::base58;
pub use self::rings_core::prelude::uuid;

Modules§

chunk
Message framing / chunking. A message larger than the connection’s negotiated max_message_size is split into MTU-sized Chunks on the sender and reassembled on the receiver.
entry
Storage entry model used by Chord-backed DHT storage.
message
Message and MessageHandler

Structs§

CustomMessage
MessageType use to customize message, will be handle by custom_message method.
MessageHandler
Shared message-handler handle.
MessagePayload
MessagePayload is used to transmit data between nodes. The data should be packed by Transaction.
MessageRelay
MessageRelay guide message passing on rings network by relay.
PeerRing
PeerRing is used to help a node interact with other nodes. All nodes in rings network form a clockwise ring in the order of Did. This struct takes its name from that. PeerRing implemented Chord algorithm. PeerRing implemented ChordStorage protocol.
SecretKey
Wrap libsecp256k1::SecretKey. which is a A 256-bit scalar value, present as [u32; 4]
Session
Session is used to verify the message. It’s serializable and can be attached to the message payload.
SessionSk
SessionSk holds the Session and its session private key. To prove that the message was sent by the Account of Session, we need to attach session and the signature signed by sk to the payload.
SessionSkBuilder
SessionSkBuilder is used to build a SessionSk.
Swarm
The transport and dht management.
SwarmBuilder
Creates a SwarmBuilder to configure a Swarm.

Enums§

Message
A collection MessageType use for unified management.

Traits§

ChordStorageInterface
ChordStorageInterface should imply necessary method for DHT storage
ChordStorageInterfaceCacheChecker
ChordStorageInterfaceCacheChecker defines the interface for checking the local cache of the DHT.
PayloadSender
Trait of PayloadSender
SubringInterface
SubringInterface should imply necessary operator for DHT Subring

Attribute Macros§

async_trait
wasm_export
If the feature is not “wasm”, the macro does nothing; otherwise, it calls wasm_bindgen. wasm_export does not work for Js Class. To export a class to js, you should use wasm_bindgen or __wasm_bindgen_class_marker. ref: https://docs.rs/wasm-bindgen-macro/0.2.86/src/wasm_bindgen_macro/lib.rs.html#51