[][src]Enum potatonet_node::bus_message::Message

pub enum Message {
    Ping,
    RegisterNode(String),
    NodeRegistered(NodeId),
    UnregisterNode,
    RegisterService {
        name: String,
        id: LocalServiceId,
    },
    UnregisterService {
        id: LocalServiceId,
    },
    Req {
        seq: u32,
        from: Option<LocalServiceId>,
        to_service: String,
        method: String,
        data: Bytes,
    },
    XReq {
        from: Option<ServiceId>,
        to: LocalServiceId,
        seq: u32,
        method: String,
        data: Bytes,
    },
    Rep {
        seq: u32,
        result: Result<Bytes, String>,
    },
    SendNotify {
        from: Option<LocalServiceId>,
        to_service: String,
        method: String,
        data: Bytes,
    },
    Notify {
        from: Option<ServiceId>,
        to_service: String,
        method: String,
        data: Bytes,
    },
    Event {
        event: Event,
    },
}

Variants

Ping

客户端发送ping

RegisterNode(String)

客户端注册节点

NodeRegistered(NodeId)

服务端发送节点注册成功消息,并返回节点id

UnregisterNode

客户端退出

RegisterService

注册服务

Fields of RegisterService

name: Stringid: LocalServiceId
UnregisterService

注销服务

Fields of UnregisterService

id: LocalServiceId
Req

客户端发送请求

Fields of Req

seq: u32from: Option<LocalServiceId>to_service: Stringmethod: Stringdata: Bytes
XReq

服务端发送请求

Fields of XReq

from: Option<ServiceId>to: LocalServiceIdseq: u32method: Stringdata: Bytes
Rep

服务端发送响应

Fields of Rep

seq: u32result: Result<Bytes, String>
SendNotify

客户端发送通知

Fields of SendNotify

from: Option<LocalServiceId>to_service: Stringmethod: Stringdata: Bytes
Notify

服务端发送通知

Fields of Notify

from: Option<ServiceId>to_service: Stringmethod: Stringdata: Bytes
Event

系统事件

Fields of Event

event: Event

Trait Implementations

impl Debug for Message[src]

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

impl Serialize 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: Deserialize<'de>, 
[src]

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.