Skip to main content

MessagePayload

Enum MessagePayload 

Source
pub enum MessagePayload {
Show 17 variants InputData { data: Vec<u8>, paste: bool, }, OutputData { data: Vec<u8>, }, Resize { columns: u16, rows: u16, }, Sealed { data: Vec<u8>, }, AuthToken { token: String, protocol: u16, }, SessionCreated { session_id: SessionId, frontend_token: String, resume_secret: Option<String>, protocol: u16, }, ResumeSecret { secret: String, }, SessionOptions { replay: bool, }, Frontend { frontend: u64, history: u32, rows: u16, sealed_history: bool, }, JoinOptions { history: u32, rows: u16, sealed_history: bool, }, ReplayData { frontend: u64, data: Vec<u8>, }, MachineId { machine: String, protocol: u16, }, Challenge { nonce: Vec<u8>, protocol: u16, rotations: Vec<KeyRotation>, }, Signature { signature: Vec<u8>, }, Record { sealed_name: Vec<u8>, sealed_key: Vec<u8>, signature: Vec<u8>, }, RecordsKept { channels: Vec<String>, previous: Vec<SessionId>, }, ErrorReason { reason: String, },
}
Expand description

Type-specific payload for a Message.

Externally tagged on the wire: an object with one key, the variant name, e.g. {"Resize":{"columns":80,"rows":24}}.

Variants§

§

InputData

Keyboard/mouse input data, sealed end to end (bytes, a JSON array of numbers). paste marks input inside a bracketed paste, sealed as such: left out when false.

Fields

§data: Vec<u8>

The sealed input.

§paste: bool

Whether it is inside a bracketed paste.

§

OutputData

Terminal stdout/stderr output, sealed end to end (bytes, a JSON array of numbers).

Fields

§data: Vec<u8>

The sealed output.

§

Resize

Terminal resize dimensions, in clear. Backend and frontend send a size sealed, as Sealed, instead.

Fields

§columns: u16

Width in columns.

§rows: u16

Height in rows.

§

Sealed

Sealed end to end, carried by resize: the relay forwards it, and cannot read it (bytes, a JSON array of numbers).

Fields

§data: Vec<u8>

The sealed bytes.

§

AuthToken

Token for authentication, carried by auth.

Fields

§token: String

The token.

§protocol: u16

The relay protocol the client speaks (PROTOCOL; 1 from a client older than the field, #95).

§

SessionCreated

Session ID and frontend token, carried by session_joined. To the backend that created or resumed the session it also carries the resume secret, which frontends never see.

Fields

§session_id: SessionId

The session’s ID.

§frontend_token: String

The token a frontend joins with.

§resume_secret: Option<String>

The resume secret, to the backend only.

§protocol: u16

The relay protocol the relay speaks (#95; 1 from a relay older than the field), for the client to check.

§

ResumeSecret

The session’s resume secret, carried by session_resume.

Fields

§secret: String

The secret.

§

SessionOptions

What the backend does, carried by session_create: with replay, it answers each frontend_joined with a replay.

Fields

§replay: bool

Whether the backend answers each joining frontend with a replay.

§

Frontend

Which frontend joined, carried by frontend_joined. The number is the relay’s, only meaningful within the session.

Fields

§frontend: u64

The relay’s number for the frontend.

§history: u32

Lines of the session’s history the frontend asked for with its join (#92): the replay holds them; 0 for none.

§rows: u16

The rows of its terminal, which the history is pushed up by (#92); 0 for the session’s.

§sealed_history: bool

Whether it takes the history the session kept on disk before a restart, sealed to the account (#93).

§

JoinOptions

What a frontend asks with its join, carried by session_join (#92): lines of the session’s history before its screen (0 for none, as a frontend older than this asks; a frontend joining again asks none).

Fields

§history: u32

Lines of history.

§rows: u16

The rows of the frontend’s terminal: the history is pushed up by as many, so all of it lands in the scrollback; 0 (or absent) for the session’s.

§sealed_history: bool

Whether it takes the history the session kept on disk before a restart, sealed to the account (#93): a device that holds the account’s keys.

§

ReplayData

The recent output for one joining frontend, carried by replay, sealed end to end (bytes, a JSON array of numbers).

Fields

§frontend: u64

The frontend it is for.

§data: Vec<u8>

The sealed recent output.

§

MachineId

Which registered machine says hello, carried by machine_hello.

Fields

§machine: String

The machine’s ID, as the relay gave it at registration.

§protocol: u16

The relay protocol the machine’s link speaks (PROTOCOL).

§

Challenge

Bytes for a machine to sign, carried by challenge.

Fields

§nonce: Vec<u8>

The challenge.

§protocol: u16

The relay protocol the relay speaks (#95).

§rotations: Vec<KeyRotation>

The machine’s account’s key rotations, oldest first (#89): the machine follows those signed from the keys it pinned.

§

Signature

A machine’s signature of its challenge, carried by machine_proof.

Fields

§signature: Vec<u8>

The Ed25519 signature.

§

Record

A session’s name and key, sealed to the account, carried by session_record.

Fields

§sealed_name: Vec<u8>

The session’s name, sealed to the account.

§sealed_key: Vec<u8>

The session’s end-to-end secret, sealed to the account for its channel.

§signature: Vec<u8>

The machine’s signature of the record (#133, account::record_bytes).

§

RecordsKept

The channels of the sessions a machine runs, carried by session_records_kept (#134).

Fields

§channels: Vec<String>

The channels that run.

§previous: Vec<SessionId>

The relay sessions the link held before this one: their records of sessions not running go too.

§

ErrorReason

Error reason from the relay.

Fields

§reason: String

The reason.

Trait Implementations§

Source§

impl Clone for MessagePayload

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MessagePayload

Source§

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

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

impl<'de> Deserialize<'de> for MessagePayload

Source§

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

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

impl Eq for MessagePayload

Source§

impl PartialEq for MessagePayload

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MessagePayload

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MessagePayload

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.