Message

Enum Message 

Source
pub enum Message {
Show 31 variants Ping { version: u64, }, Pong { mac: String, version: u64, }, Auth { token: String, worker_id: Option<String>, worker_name: Option<String>, }, Join { token: String, }, AuthOk, AuthErr, TokenRefreshRequest { token: String, }, TokenRefreshOk { token: String, }, TokenRefreshErr { reason: String, }, Hello { manager_id: String, nonce: [u8; 32], sig: Vec<u8>, }, Welcome { manager_id: String, nonce: [u8; 32], sig: Vec<u8>, }, ClusterKey { ver: u32, csk: [u8; 32], }, JoinResponse { ver: u32, csk: [u8; 32], peer: Box<ManagerPeerEntry>, }, ClientAuth { token: String, }, ClientCommandRequest { request_id: String, command: String, args: Vec<String>, target: String, timeout_secs: u64, options: String, }, ClientCommandResponse { request_id: String, worker_id: String, worker_name: Option<String>, success: bool, duration_millis: u64, output: String, }, ClientCommandHeader { request_id: String, worker_id: String, worker_name: Option<String>, payload: Vec<u8>, }, ClientCommandStream { request_id: String, worker_id: String, worker_name: Option<String>, payload: Vec<u8>, }, ClientCommandFooter { request_id: String, worker_id: String, worker_name: Option<String>, payload: Vec<u8>, duration_millis: u64, success: bool, }, ClientCommandComplete { request_id: String, total_workers: u32, }, ClientCommandError { request_id: String, error: String, }, ClientCommandCancel { request_id: String, }, WorkerCommandRequest { request_id: String, command: String, args: Vec<String>, timeout_secs: u64, options: String, }, WorkerCommandResponse { request_id: String, worker_id: String, success: bool, duration_millis: u64, output: String, }, WorkerCommandHeader { request_id: String, worker_id: String, payload: Vec<u8>, }, WorkerCommandStream { request_id: String, worker_id: String, payload: Vec<u8>, }, WorkerCommandFooter { request_id: String, worker_id: String, payload: Vec<u8>, duration_millis: u64, success: bool, }, WorkerCommandError { request_id: String, error: String, }, WorkerCommandCancel { request_id: String, }, Announce { meta: Box<ManagerPeerEntry>, version: u64, peers: Vec<ManagerPeerEntry>, workers: Vec<WorkerEntry>, }, Goodbye,
}
Expand description

Basic message type used between worker and server.

Variants§

§

Ping

Fields

§version: u64
§

Pong

Fields

§version: u64
§

Auth

Fields

§token: String
§worker_id: Option<String>
§worker_name: Option<String>
§

Join

Fields

§token: String
§

AuthOk

§

AuthErr

§

TokenRefreshRequest

Fields

§token: String
§

TokenRefreshOk

Fields

§token: String
§

TokenRefreshErr

Fields

§reason: String
§

Hello

Fields

§manager_id: String
§nonce: [u8; 32]
§sig: Vec<u8>
§

Welcome

Fields

§manager_id: String
§nonce: [u8; 32]
§sig: Vec<u8>
§

ClusterKey

Fields

§ver: u32
§csk: [u8; 32]
§

JoinResponse

Join response with cluster key and peer info

Fields

§ver: u32
§csk: [u8; 32]
§

ClientAuth

Client authentication using cluster keys

Fields

§token: String
§

ClientCommandRequest

Client command request for distributed execution

Fields

§request_id: String
§command: String
§args: Vec<String>
§target: String
§timeout_secs: u64
§options: String
§

ClientCommandResponse

Client command response

Fields

§request_id: String
§worker_id: String
§worker_name: Option<String>
§success: bool
§duration_millis: u64
§output: String
§

ClientCommandHeader

Client streaming: header frame (manager -> client)

Fields

§request_id: String
§worker_id: String
§worker_name: Option<String>
§payload: Vec<u8>
§

ClientCommandStream

Client streaming: progress frame (manager -> client)

Fields

§request_id: String
§worker_id: String
§worker_name: Option<String>
§payload: Vec<u8>
§

ClientCommandFooter

Client streaming: footer/completion frame per worker (manager -> client)

Fields

§request_id: String
§worker_id: String
§worker_name: Option<String>
§payload: Vec<u8>
§duration_millis: u64
§success: bool
§

ClientCommandComplete

Client command completion

Fields

§request_id: String
§total_workers: u32
§

ClientCommandError

Client command error

Fields

§request_id: String
§error: String
§

ClientCommandCancel

Client command cancel request

Fields

§request_id: String
§

WorkerCommandRequest

Worker command request (manager -> worker)

Fields

§request_id: String
§command: String
§args: Vec<String>
§timeout_secs: u64
§options: String
§

WorkerCommandResponse

Worker command response with results (worker -> manager)

Fields

§request_id: String
§worker_id: String
§success: bool
§duration_millis: u64
§output: String
§

WorkerCommandHeader

Worker streaming header (binary payload of CommandHeader)

Fields

§request_id: String
§worker_id: String
§payload: Vec<u8>
§

WorkerCommandStream

Worker streaming frame (binary payload of CommandStream)

Fields

§request_id: String
§worker_id: String
§payload: Vec<u8>
§

WorkerCommandFooter

Worker streaming footer (binary payload of CommandFooter)

Fields

§request_id: String
§worker_id: String
§payload: Vec<u8>
§duration_millis: u64
§success: bool
§

WorkerCommandError

Worker command error (worker -> manager)

Fields

§request_id: String
§error: String
§

WorkerCommandCancel

Cancel a running command on a worker (manager -> worker)

Fields

§request_id: String
§

Announce

Manager heartbeat and peer list gossip.

version is a monotonically increasing counter for the sender’s peer table. peers contains the full list of known peers when version has advanced since the last heartbeat; otherwise it may be empty to indicate no changes.

Fields

§version: u64
§workers: Vec<WorkerEntry>

List of known workers when version has advanced. Empty otherwise.

§

Goodbye

Worker indicates it is intentionally closing this session (e.g., after migration)

Trait Implementations§

Source§

impl Debug for Message

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Message

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Message, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Message

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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