Skip to main content

RpcMessageType

Enum RpcMessageType 

Source
#[repr(u32)]
pub enum RpcMessageType {
Show 16 variants Create = 257, Start = 513, ShutdownGraceful = 769, ShutdownForced = 1_025, ExecuteProcess = 1_281, WaitForProcess = 1_537, SignalProcess = 1_793, ResizeConsole = 2_049, GetProperties = 2_305, ModifySettings = 2_561, NegotiateProtocol = 2_817, DumpStacks = 3_073, DeleteContainerState = 3_329, UpdateContainer = 3_585, LifecycleNotification = 3_841, ModifyServiceSettings = 65_793,
}
Expand description

RPC type codes for the ComputeSystem category.

Each value already encodes (iota+1)<<8 | 1 per hcsshim’s RPCProc = Category | (iota+1)<<8 | 1 formula in internal/gcs/prot/protocol.go, so a NegotiateProtocol REQUEST frame’s wire type is exactly MSG_TYPE_REQUEST | CATEGORY_COMPUTE_SYSTEM | (rpc as u32) = 0x10100B01. An earlier iteration of this enum used 0x0001..=0x000A and was missing both the per-RPC (iota+1)<<8 byte AND the MSG_TYPE_REQUEST marker, causing the in-guest GCS to close the bridge the moment it saw a frame with an unrecognized type (verified via gcs-bridge-reader: header read failed after 0 frame(s): bridge closed against nanoserver:ltsc2022 with the dep-override applied).

Variants§

§

Create = 257

§

Start = 513

§

ShutdownGraceful = 769

§

ShutdownForced = 1_025

§

ExecuteProcess = 1_281

§

WaitForProcess = 1_537

§

SignalProcess = 1_793

§

ResizeConsole = 2_049

§

GetProperties = 2_305

§

ModifySettings = 2_561

§

NegotiateProtocol = 2_817

§

DumpStacks = 3_073

§

DeleteContainerState = 3_329

§

UpdateContainer = 3_585

§

LifecycleNotification = 3_841

§

ModifyServiceSettings = 65_793

RPCModifyServiceSettings — the ONLY RPC in hcsshim’s ComputeService category (internal/gcs/prot/protocol.go): RPCModifyServiceSettings RPCProc = ComputeService | (iota+1)<<8 | 1. iota RESETS to 0 in that second const block, so the per-RPC byte is (0+1)<<8 = 0x100 and the low 16 bits are 0x0101 — identical to Create’s low bits, but it lives in a DIFFERENT category (ComputeService = 0x0020_0000, not ComputeSystem = 0x0010_0000). Used to drive the in-guest GCS log-forward service (internal/uvm/log_wcow.go). Because the category differs, the discriminant alone cannot be OR’d with CATEGORY_COMPUTE_SYSTEMRpcMessageType::as_request_type special-cases it. The discriminant is offset into a private range so it does not numerically collide with Create = 0x0101 inside the Rust enum.

Implementations§

Source§

impl RpcMessageType

Source

pub const fn as_request_type(self) -> u32

Encode as the on-wire request type u32: MSG_TYPE_REQUEST | category | rpc.

Source

pub const fn as_response_type(self) -> u32

Encode as the expected on-wire response type u32: MSG_TYPE_RESPONSE | category | rpc.

Trait Implementations§

Source§

impl Clone for RpcMessageType

Source§

fn clone(&self) -> RpcMessageType

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 Copy for RpcMessageType

Source§

impl Debug for RpcMessageType

Source§

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

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

impl Eq for RpcMessageType

Source§

impl Hash for RpcMessageType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RpcMessageType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RpcMessageType

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