Skip to main content

Module message

Module message 

Source
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§

ConnectNodeReport
MessageType report to origin with own transport_uuid and handshake_info.
ConnectNodeSend
MessageType use to ask for connection, send to remote with transport_uuid and handshake_info.
CustomMessage
MessageType use to customize message, will be handle by custom_message method.
Encoded
FindSuccessorReport
MessageType use to report origin node with report message.
FindSuccessorSend
MessageType use to find successor in a chord ring.
FoundEntry
MessageType used to report found DHT storage entries to the origin.
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.
MessageVerification
Message Verification is based on session, and sig. it also included ttl time and created ts.
NotifyPredecessorReport
MessageType use to tell the real predecessor of current node.
NotifyPredecessorSend
MessageType use notify the successor about the predecessor inferred by current node.
QueryForTopoInfoReport
MessageType for handle crate::dht::PeerRingRemoteAction::QueryForSuccessorList
QueryForTopoInfoSend
MessageType for handle crate::dht::PeerRingRemoteAction::QueryForSuccessorList
SearchEntry
MessageType used to search a DHT storage entry.
SyncEntriesWithSuccessor
MessageType after FindSuccessorSend and syncing data.
SyncEntriesWithSuccessorReport
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§

FindSuccessorReportHandler
MessageType enum handle when meet the last node.
FindSuccessorThen
MessageType enum Report contain FindSuccessorSend.
Message
A collection MessageType use for unified management.
QueryFor
The reason of query successor’s TopoInfo

Traits§

ChordStorageInterface
ChordStorageInterface should imply necessary method for DHT storage
ChordStorageInterfaceCacheChecker
ChordStorageInterfaceCacheChecker defines the interface for checking the local cache of the DHT.
Decoder
Encoder
HandleMsg
Generic trait for handle message ,inspired by Actor-Model.
MessageVerificationExt
This trait helps a struct with MessageVerification field to verify itself. It also provides a signer method to let receiver know who sent the message.
PayloadSender
Trait of PayloadSender
SubringInterface
SubringInterface should imply necessary operator for DHT Subring
Then
The Then trait 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.