Enum sn_messaging::client::Message[][src]

pub enum Message {
    Cmd {
        cmd: Cmd,
        id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    Query {
        query: Query,
        id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    Event {
        event: Event,
        id: MessageId,
        correlation_id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    QueryResponse {
        response: QueryResponse,
        id: MessageId,
        correlation_id: MessageId,
        query_origin: SrcLocation,
        target_section_pk: Option<PublicKey>,
    },
    CmdError {
        error: CmdError,
        id: MessageId,
        correlation_id: MessageId,
        cmd_origin: SrcLocation,
        target_section_pk: Option<PublicKey>,
    },
    NodeCmd {
        cmd: NodeCmd,
        id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    NodeCmdError {
        error: NodeCmdError,
        id: MessageId,
        correlation_id: MessageId,
        cmd_origin: SrcLocation,
        target_section_pk: Option<PublicKey>,
    },
    NodeEvent {
        event: NodeEvent,
        id: MessageId,
        correlation_id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    NodeQuery {
        query: NodeQuery,
        id: MessageId,
        target_section_pk: Option<PublicKey>,
    },
    NodeQueryResponse {
        response: NodeQueryResponse,
        id: MessageId,
        correlation_id: MessageId,
        query_origin: SrcLocation,
        target_section_pk: Option<PublicKey>,
    },
}

Variants

Cmd

A Cmd is leads to a write / change of state. We expect them to be successful, and only return a msg if something went wrong.

Fields of Cmd

cmd: Cmd

Cmd.

id: MessageId

Message ID.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

Query

Queries is a read-only operation.

Fields of Query

query: Query

Query.

id: MessageId

Message ID.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

Event

An Event is a fact about something that happened.

Fields of Event

event: Event

Request.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing cmd.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

QueryResponse

The response to a query, containing the query result.

Fields of QueryResponse

response: QueryResponse

QueryResponse.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing query.

query_origin: SrcLocation

The sender of the causing query.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

CmdError

Cmd error.

Fields of CmdError

error: CmdError

The error.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing cmd.

cmd_origin: SrcLocation

The sender of the causing cmd.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

NodeCmd

Cmds only sent internally in the network.

Fields of NodeCmd

cmd: NodeCmd

NodeCmd.

id: MessageId

Message ID.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

NodeCmdError

An error of a NodeCmd.

Fields of NodeCmdError

error: NodeCmdError

The error.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing cmd.

cmd_origin: SrcLocation

The sender of the causing cmd.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

NodeEvent

Events only sent internally in the network.

Fields of NodeEvent

event: NodeEvent

Request.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing cmd.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

NodeQuery

Queries is a read-only operation.

Fields of NodeQuery

query: NodeQuery

Query.

id: MessageId

Message ID.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

NodeQueryResponse

The response to a query, containing the query result.

Fields of NodeQueryResponse

response: NodeQueryResponse

QueryResponse.

id: MessageId

Message ID.

correlation_id: MessageId

ID of causing query.

query_origin: SrcLocation

The sender of the causing query.

target_section_pk: Option<PublicKey>

Target section’s current PublicKey

Implementations

impl Message[src]

Message envelope containing a Safe message payload, This struct also provides utilities to obtain the serialized bytes ready to send them over the wire.

pub fn from(bytes: Bytes) -> Result<Self>[src]

Convenience function to deserialize a ‘Message’ from bytes received over the wire. It returns an error if the bytes don’t correspond to a client message.

pub fn serialize(&self) -> Result<Bytes>[src]

serialize this Message into bytes ready to be sent over the wire.

impl Message[src]

pub fn id(&self) -> MessageId[src]

Gets the message ID.

pub fn target_section_pk(&self) -> Option<PublicKey>[src]

Gets the message’s expected section PublicKey.

Trait Implementations

impl Clone for Message[src]

impl Debug for Message[src]

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

impl Eq for Message[src]

impl PartialEq<Message> for Message[src]

impl Serialize for Message[src]

impl StructuralEq for Message[src]

impl StructuralPartialEq for Message[src]

Auto Trait Implementations

impl RefUnwindSafe for Message

impl Send for Message

impl Sync for Message

impl Unpin for Message

impl UnwindSafe for Message

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> DeserializeOwned for T where
    T: for<'de> 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>,