Skip to main content

HostMessage

Enum HostMessage 

Source
pub enum HostMessage {
    HelloAck {
        accepted: Vec<String>,
        rejected: Vec<String>,
        idle_timeout_secs: u64,
        host_exec_shims: Vec<String>,
    },
    ClipboardData {
        text: String,
    },
    HostExecStdout {
        data: String,
    },
    HostExecStderr {
        data: String,
    },
    HostExecOutput {
        stream: ExecStream,
        data: Vec<u8>,
    },
    HostExecDone {
        exit_code: i32,
        signal: Option<i32>,
    },
    NotifyActionResult {
        notification_id: u32,
        action_key: String,
    },
    Ping,
    Shutdown,
    CheckIdle,
    Error {
        reason: String,
        code: Option<String>,
    },
    GetInfo,
}
Expand description

Messages sent from host to guest.

Variants§

§

HelloAck

Fields

§accepted: Vec<String>
§rejected: Vec<String>
§idle_timeout_secs: u64
§host_exec_shims: Vec<String>

List of command names for which the guest daemon should create PATH shims.

§

ClipboardData

Fields

§text: String
§

HostExecStdout

Fields

§data: String
§

HostExecStderr

Fields

§data: String
§

HostExecOutput

One chunk of a streaming command’s output, sent as the child produces it. data is raw bytes (up to 16 KiB per chunk) so binary output survives intact. Only sent when the guest negotiated host_exec_stream; older guests keep receiving the buffered HostExecStdout/HostExecStderr frames.

Fields

§stream: ExecStream
§data: Vec<u8>
§

HostExecDone

Fields

§exit_code: i32
§signal: Option<i32>

Signal that killed the child, if any. exit_code already follows the shell convention (128 + signal); this names the cause. Old guests ignore the unknown field.

§

NotifyActionResult

Fields

§notification_id: u32
§action_key: String
§

Ping

§

Shutdown

§

CheckIdle

Sent by the host when all CLI sessions have ended; guest responds with IdleTimeout or Busy after scanning /proc.

§

Error

Sent by the host when a guest message is rejected (missing Hello negotiation, or a capability that was not accepted).

Fields

§reason: String
§code: Option<String>

Optional machine-readable code (e.g. busy) so clients can distinguish rejection kinds without parsing reason.

§

GetInfo

Host → guest version/info query (doctor).

Trait Implementations§

Source§

impl Debug for HostMessage

Source§

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

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

impl<'de> Deserialize<'de> for HostMessage

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 Serialize for HostMessage

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

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