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

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

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.)

FailureResult(GenericResultData)

Failure response to a request (any Command with an request_id field.) Can also be a response to a mal-formed request.

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.

HoldEntry(ProvidedEntryData)

Tell network module Core is holding this entry

QueryEntry(QueryEntryData)

Request some info / data from a Entry

HandleQueryEntryResult(QueryEntryResultData)

Response to a HandleQueryEntry request

HandleGetAuthoringEntryListResult(EntryListData)HandleGetGossipingEntryListResult(EntryListData)

Trait Implementations

impl Clone for Lib3hClientProtocol[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Lib3hClientProtocol> for Lib3hClientProtocol[src]

impl Debug for Lib3hClientProtocol[src]

impl Serialize for Lib3hClientProtocol[src]

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

Auto Trait Implementations

Blanket Implementations

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

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

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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