Module rings_node::prelude::message
source · Expand description
Message and MessageHandler
Modules
- This module implemented message handler of rings network.
- 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
- MessageType report to origin with own transport_uuid and handshake_info.
- MessageType use to ask for connection, send to remote with transport_uuid and handshake_info.
- MessageType use to customize message, will be handle by
custom_message
method. - MessageType use to report origin node with report message.
- MessageType use to find successor in a chord ring.
- MessageType report to origin found virtual node.
- MessageType use to join chord ring, add did into fingers table.
- MessageType use to leave chord ring.
- 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.
- MessageType report to origin node.
- MessageType use to notify predecessor, ask for update finger tables.
- MessageType for handle [RemoteAction::Queryforsuccessorlist]
- MessageType for handle [RemoteAction::Queryforsuccessorlist]
- MessageType use to search virtual node.
- MessageType after
FindSuccessorSend
and syncing data.
Enums
- MessageType enum handle when meet the last node.
- MessageType enum Report contain FindSuccessorSend.
- A collection MessageType use for unified management.
- MessageHandlerEvent that will be handled by Swarm.
- An enumeration of options for generating origin verification or stick verification. Verification can be Stick Verification or origin verification. When MessagePayload created, Origin Verification is always generated. and if OriginVerificationGen is stick, it can including existing stick ov
- The reason of query successor’s TopoInfo
Traits
- ChordStorageInterface should imply necessary method for DHT storage
- ChordStorageInterfaceCacheChecker defines the interface for checking the local cache of the DHT.
- Generic trait for handle message ,inspired by Actor-Model.
- Trait of message callback.
- Trait of PayloadSender
- SubringInterface should imply necessary operator for DHT Subring
- The
Then
trait is used to associate a type with a “then” scenario.
Functions
- Decompresses the given gzip-compressed byte slice and returns the decompressed byte slice.
- Compresses the given data byte slice using the gzip algorithm with the specified compression level.
- From gzip data to deserialized
- Serializes the given data using JSON and compresses it with gzip using the specified compression level.
Type Aliases
- Boxed Callback, for non-wasm, it should be Sized, Send and Sync.
- Boxed Validator