Expand description
Message and MessageHandler
Modules§
- e2e
- End-to-end ElGamal encryption for byte payloads.
- handlers
- This module implemented message handler of rings network.
- types
- This module defines various message structures in the Rings network. Most of the messages follow the Ping/Pong pattern, where there is a one-to-one correspondence between them, such as xxxSend and xxxReport messages.
Structs§
- Connect
Node Report - MessageType report to origin with own transport_uuid and handshake_info.
- Connect
Node Send - MessageType use to ask for connection, send to remote with transport_uuid and handshake_info.
- Custom
Message - MessageType use to customize message, will be handle by
custom_messagemethod. - Encoded
- Find
Successor Report - MessageType use to report origin node with report message.
- Find
Successor Send - MessageType use to find successor in a chord ring.
- Found
Entry - MessageType used to report found DHT storage entries to the origin.
- Message
Handler - Shared message-handler handle.
- Message
Payload MessagePayloadis used to transmit data between nodes. The data should be packed by Transaction.- Message
Relay - MessageRelay guide message passing on rings network by relay.
- Message
Verification - Message Verification is based on session, and sig. it also included ttl time and created ts.
- Notify
Predecessor Report - MessageType use to tell the real predecessor of current node.
- Notify
Predecessor Send - MessageType use notify the successor about the predecessor inferred by current node.
- Query
ForTopo Info Report - MessageType for handle crate::dht::PeerRingRemoteAction::QueryForSuccessorList
- Query
ForTopo Info Send - MessageType for handle crate::dht::PeerRingRemoteAction::QueryForSuccessorList
- Search
Entry - MessageType used to search a DHT storage entry.
- Sync
Entries With Successor - MessageType after
FindSuccessorSendand syncing data. - Sync
Entries With Successor Report - MessageType used to acknowledge durable storage of synced entries.
- Transaction
- All messages transmitted in RingsNetwork should be wrapped by
Transaction. It additionally offer destination, tx_id and verification.
Enums§
- Find
Successor Report Handler - MessageType enum handle when meet the last node.
- Find
Successor Then - MessageType enum Report contain FindSuccessorSend.
- Message
- A collection MessageType use for unified management.
- Query
For - The reason of query successor’s TopoInfo
Traits§
- Chord
Storage Interface - ChordStorageInterface should imply necessary method for DHT storage
- Chord
Storage Interface Cache Checker - ChordStorageInterfaceCacheChecker defines the interface for checking the local cache of the DHT.
- Decoder
- Encoder
- Handle
Msg - Generic trait for handle message ,inspired by Actor-Model.
- Message
Verification Ext - This trait helps a struct with
MessageVerificationfield toverifyitself. It also provides asignermethod to let receiver know who sent the message. - Payload
Sender - Trait of PayloadSender
- Subring
Interface - SubringInterface should imply necessary operator for DHT Subring
- Then
- The
Thentrait is used to associate a type with a “then” scenario.
Functions§
- decode_
gzip_ data - Decompresses the given gzip-compressed byte slice and returns the decompressed byte slice.
- encode_
data_ gzip - Compresses the given data byte slice using the gzip algorithm with the specified compression level.
- from_
gzipped_ data - From gzip data to deserialized
- gzip_
data - Serializes the given data using JSON and compresses it with gzip using the specified compression level.