Module rings_node::prelude
source · Expand description
A prelude is provided which imports all the important data types and traits of ring-network.
Re-exports
pub use reqwest;
pub use rings_core;
pub use rings_rpc;
pub use rings_rpc::prelude::http;
pub use rings_rpc::prelude::jsonrpc_core;
pub use self::rings_core::prelude::base58;
pub use self::rings_core::prelude::uuid;
pub use self::rings_core::prelude::web3;
Modules
- A Framing and Message chucking implementation defined in RFC4917https://www.rfc-editor.org/rfc/rfc4975#page-9 This chunking mechanism allows a sender to interrupt a chunk part of the way through sending it. The ability to interrupt messages allows multiple sessions to share a TCP connection, and for large messages to be sent efficiently while not blocking other messages that share the same connection, or even the same MSRP session.
- A jsonrpc-client.
- Message and MessageHandler
- VNode is a special node that only has virtual address
Structs
- MessageType use to customize message, will be handle by
custom_message
method. - MessageHandler will manage resources.
- All messages transmitted in RingsNetwork should be wrapped by MessagePayload. It additionally offer transaction ID, origin did, relay, previous hop verification, and origin verification.
- MessageRelay guide message passing on rings network by relay.
- 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.
- StorageInstance struct
- Wrap libsecp256k1::SecretKey.
- Session is used to verify the message. It’s serializable and can be attached to the message payload.
- SessionSkBuilder is used to build a SessionSk.
- The transport and dht management.
- Creates a SwarmBuilder to configure a Swarm.
Enums
- A collection MessageType use for unified management.
- MessageHandlerEvent that will be handled by Swarm.
Traits
- ChordStorageInterface should imply necessary method for DHT storage
- ChordStorageInterfaceCacheChecker defines the interface for checking the local cache of the DHT.
- Trait of message callback.
- Trait of PayloadSender
- Persistence Storage read and write functions
- SubringInterface should imply necessary operator for DHT Subring
Type Aliases
- Boxed Callback, for non-wasm, it should be Sized, Send and Sync.
Attribute Macros
- 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