[][src]Struct replit_protocol::Command

pub struct Command {
    pub channel: i32,
    pub session: i32,
    pub ref: String,
    pub body: Option<Body>,
}

This is the structure of all sent and received messages. It provides a reusable interface for both the client and container to use.

Fields

channel: i32

Used to determine the channel's id which originally sent or should receive the command. A global channel with id 0 always exists which is used to create/close channels and receive global commands (relating to the container generally).

session: i32

Used internally to determine some routing stuff. Setting this doesn't do anything so it's best to set this to 0. The table below can also be ignored as it's only there for reference.

< 0 : all user sessions except abs(id) 0 : all user sessions 1 : internal message to conman

1 : user session with given id

ref: String

Used to give a command a unique (depending on the usage) reference which can be used to separate its response(s) from other incoming responses.

body: Option<Body>

Used to store the actual data for a specific command which is being sent or received.

If an unexpected command is sent to the container there is a multitude of things that may happen. An unexpected command sent from the global channel (with id 0) is likely to kill the container.

global messages

Trait Implementations

impl Clone for Command[src]

impl Debug for Command[src]

impl Default for Command[src]

impl Message for Command[src]

impl PartialEq<Command> for Command[src]

impl StructuralPartialEq for Command[src]

Auto Trait Implementations

impl RefUnwindSafe for Command

impl Send for Command

impl Sync for Command

impl Unpin for Command

impl UnwindSafe for Command

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