[][src]Enum lib3h_protocol::protocol_server::Lib3hServerProtocol

pub enum Lib3hServerProtocol {
    SuccessResult(GenericResultData),
    FailureResult(GenericResultData),
    Connected(ConnectedData),
    Disconnected(DisconnectedData),
    SendDirectMessageResult(DirectMessageData),
    HandleSendDirectMessage(DirectMessageData),
    FetchEntryResult(FetchEntryResultData),
    HandleFetchEntry(FetchEntryData),
    HandleStoreEntryAspect(StoreEntryAspectData),
    HandleDropEntry(DropEntryData),
    HandleQueryEntry(QueryEntryData),
    QueryEntryResult(QueryEntryResultData),
    HandleGetAuthoringEntryList(GetListData),
    HandleGetGossipingEntryList(GetListData),
    Terminated,
    P2pReady,
}

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.

Connected(ConnectedData)

Notification of successful connection to a network

Disconnected(DisconnectedData)

Notification of disconnection from a network

SendDirectMessageResult(DirectMessageData)

the response received from a previous SendDirectMessage

HandleSendDirectMessage(DirectMessageData)

Request to handle a direct message another agent has sent us.

FetchEntryResult(FetchEntryResultData)

Response from requesting dht data from the network

HandleFetchEntry(FetchEntryData)

Another node, or the network module itself is requesting data from us

HandleStoreEntryAspect(StoreEntryAspectData)

Store data on a node's dht arc.

HandleDropEntry(DropEntryData)

Local client does not need to hold that entry anymore. Local client doesn't 'have to' comply.

HandleQueryEntry(QueryEntryData)

Request a node to handle a QueryEntry request

QueryEntryResult(QueryEntryResultData)

Response to a QueryEntry request

HandleGetAuthoringEntryList(GetListData)HandleGetGossipingEntryList(GetListData)TerminatedP2pReady

Trait Implementations

impl PartialEq<Lib3hServerProtocol> for Lib3hServerProtocol[src]

impl Clone for Lib3hServerProtocol[src]

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

Performs copy-assignment from source. Read more

impl Debug for Lib3hServerProtocol[src]

impl Serialize for Lib3hServerProtocol[src]

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

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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

impl<T> Borrow<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]