[][src]Enum lib3h_protocol::protocol_client::Lib3hClientProtocol

pub enum Lib3hClientProtocol {
    SuccessResult(GenericResultData),
    Connect(ConnectData),
    JoinSpace(SpaceData),
    LeaveSpace(SpaceData),
    SendDirectMessage(DirectMessageData),
    HandleSendDirectMessageResult(DirectMessageData),
    FetchEntry(FetchEntryData),
    HandleFetchEntryResult(FetchEntryResultData),
    PublishEntry(ProvidedEntryData),
    QueryEntry(QueryEntryData),
    HandleQueryEntryResult(QueryEntryResultData),
    HandleGetAuthoringEntryListResult(EntryListData),
    HandleGetGossipingEntryListResult(EntryListData),
    Shutdown,
}

Enum holding all message types in the 'hc-core -> P2P network module' protocol. There are 4 categories of messages:

  • Command: An order from the local node to the p2p module. Local node expects a reponse. Starts with a verb.
  • Handle-command: An order from the p2p module to the local node. The p2p module expects a response. Start withs 'Handle' followed by a verb.
  • Result: A response to a Command. Starts with the name of the Command it responds to and ends with 'Result'.
  • Notification: Notify that something happened. Not expecting any response. Ends with verb in past form, i.e. '-ed'. Fetch = Request between node and the network (other nodes) Get = Request within a node between p2p module and core

Variants

SuccessResult(GenericResultData)

Success response to a request (any Command with an request_id field.)

Connect(ConnectData)

Connect to the specified multiaddr

JoinSpace(SpaceData)

Order the p2p module to be part of the network of the specified space.

LeaveSpace(SpaceData)

Order the p2p module to leave the network of the specified space.

SendDirectMessage(DirectMessageData)

Send a message directly to another agent on the network

HandleSendDirectMessageResult(DirectMessageData)

Our response to a direct message from another agent.

FetchEntry(FetchEntryData)

Request an Entry from the dht network

HandleFetchEntryResult(FetchEntryResultData)

Successful data response for a HandleFetchEntryData request

PublishEntry(ProvidedEntryData)

Publish data to the dht.

QueryEntry(QueryEntryData)

Request some info / data from a Entry

HandleQueryEntryResult(QueryEntryResultData)

Response to a HandleQueryEntry request

HandleGetAuthoringEntryListResult(EntryListData)
HandleGetGossipingEntryListResult(EntryListData)
Shutdown

Trait Implementations

impl Clone for Lib3hClientProtocol[src]

impl Debug for Lib3hClientProtocol[src]

impl<'de> Deserialize<'de> for Lib3hClientProtocol[src]

impl From<ClientToLib3h> for Lib3hClientProtocol[src]

impl From<Lib3hToClientResponse> for Lib3hClientProtocol[src]

impl PartialEq<Lib3hClientProtocol> for Lib3hClientProtocol[src]

impl Serialize for Lib3hClientProtocol[src]

impl StructuralPartialEq for Lib3hClientProtocol[src]

impl TryFrom<Lib3hClientProtocol> for ClientToLib3h[src]

type Error = Lib3hProtocolError

The type returned in the event of a conversion error.

impl TryFrom<Lib3hClientProtocol> for Lib3hToClientResponse[src]

type Error = Lib3hProtocolError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Clone for T where
    T: Clone
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,