Struct PortalControlCommand
#[repr(transparent)]pub struct PortalControlCommand {
pub raw: u64,
}Expand description
Packed ICP command (8 bytes).
Fields§
§raw: u64Implementations§
§impl PortalControlCommand
impl PortalControlCommand
pub const fn empty() -> PortalControlCommand
pub const fn empty() -> PortalControlCommand
Empty value.
pub fn has_icp_magic(self) -> bool
pub fn has_icp_magic(self) -> bool
true when bit 63 (ICP magic) is set — distinguishes packed control words from plain data.
16-bit tensor/menu index field (bits 16..31).
pub fn param_a_i16(self) -> i16
pub fn param_a_i16(self) -> i16
Signed 16-bit parameter A (bits 32..47).
pub fn param_b_i8(self) -> i8
pub fn param_b_i8(self) -> i8
Signed 8-bit parameter B (bits 48..55).
pub fn with_magic(self) -> PortalControlCommand
pub fn with_magic(self) -> PortalControlCommand
Sets the ICP magic bit, marking this word as a packed control command.
pub fn pack(
opcode: u8,
channel: u8,
index: u16,
param_a: i16,
param_b: i8,
) -> PortalControlCommand
pub fn pack( opcode: u8, channel: u8, index: u16, param_a: i16, param_b: i8, ) -> PortalControlCommand
Packs opcode/channel/index/param_a/param_b into one u64 word with ICP magic set.
pub fn set_camera_delta_scaled(
dyaw: f32,
dpitch: f32,
dzoom: f32,
) -> PortalControlCommand
pub fn set_camera_delta_scaled( dyaw: f32, dpitch: f32, dzoom: f32, ) -> PortalControlCommand
Pack camera deltas: param_a = dyaw×1000, index = dpitch×1000 (i16), param_b = dzoom×1000.
pub fn decode_camera_delta(self) -> (f32, f32, f32)
pub fn decode_camera_delta(self) -> (f32, f32, f32)
Unpacks a set_camera_delta_scaled command into (dyaw, dpitch, dzoom) floats.
Builds an OP_NAVIGATE_INDEX command for index.
pub fn collapse_q(index: u16) -> PortalControlCommand
pub fn collapse_q(index: u16) -> PortalControlCommand
Builds an OP_COLLAPSE_Q command for index.
Builds an OP_MENU_ACTION command for menu_id.
pub fn standpoint_scalar(kind: u8, delta: f32) -> PortalControlCommand
pub fn standpoint_scalar(kind: u8, delta: f32) -> PortalControlCommand
Builds an OP_SET_STANDPOINT_SCALAR command; delta is quantized ×1000 into param A.
pub fn sonic_token_forward(token_raw: u64) -> PortalControlCommand
pub fn sonic_token_forward(token_raw: u64) -> PortalControlCommand
Embed a Sonic Token payload (bits 0..62); opcode + ICP magic in low byte / bit 63.
pub fn embedded_sonic_raw(self) -> u64
pub fn embedded_sonic_raw(self) -> u64
Extracts the embedded Sonic Token payload (bits 8..62) from a forward command.
Trait Implementations§
§impl Clone for PortalControlCommand
impl Clone for PortalControlCommand
§fn clone(&self) -> PortalControlCommand
fn clone(&self) -> PortalControlCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PortalControlCommand
§impl Debug for PortalControlCommand
impl Debug for PortalControlCommand
impl Eq for PortalControlCommand
§impl PartialEq for PortalControlCommand
impl PartialEq for PortalControlCommand
impl StructuralPartialEq for PortalControlCommand
Auto Trait Implementations§
impl Freeze for PortalControlCommand
impl RefUnwindSafe for PortalControlCommand
impl Send for PortalControlCommand
impl Sync for PortalControlCommand
impl Unpin for PortalControlCommand
impl UnsafeUnpin for PortalControlCommand
impl UnwindSafe for PortalControlCommand
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more