pub struct CommandMessage {
pub command_id: u32,
pub command_name: String,
pub encoding: u16,
pub command: String,
}
Expand description
COMMAND message containing command data with ID and name
§OpenIGTLink Specification
- Message type: “COMMAND”
- Body format: COMMAND_ID (uint32) + COMMAND_NAME (
char[20]
) + ENCODING (uint16) + LENGTH (uint32) + COMMAND (uint8[LENGTH]
) - Character encoding: MIBenum value (default: 3 = US-ASCII)
Fields§
§command_id: u32
Unique ID of this command
command_name: String
Name of the command (max 20 chars)
encoding: u16
Character encoding as MIBenum value Common values:
- 3: US-ASCII (default)
- 106: UTF-8
command: String
The command string (often XML)
Implementations§
Source§impl CommandMessage
impl CommandMessage
Sourcepub fn new(
command_id: u32,
command_name: impl Into<String>,
command: impl Into<String>,
) -> Self
pub fn new( command_id: u32, command_name: impl Into<String>, command: impl Into<String>, ) -> Self
Create a new COMMAND message with US-ASCII encoding
Sourcepub fn utf8(
command_id: u32,
command_name: impl Into<String>,
command: impl Into<String>,
) -> Self
pub fn utf8( command_id: u32, command_name: impl Into<String>, command: impl Into<String>, ) -> Self
Create a COMMAND message with UTF-8 encoding
Trait Implementations§
Source§impl Clone for CommandMessage
impl Clone for CommandMessage
Source§fn clone(&self) -> CommandMessage
fn clone(&self) -> CommandMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CommandMessage
impl Debug for CommandMessage
Source§impl Message for CommandMessage
impl Message for CommandMessage
Source§impl PartialEq for CommandMessage
impl PartialEq for CommandMessage
impl StructuralPartialEq for CommandMessage
Auto Trait Implementations§
impl Freeze for CommandMessage
impl RefUnwindSafe for CommandMessage
impl Send for CommandMessage
impl Sync for CommandMessage
impl Unpin for CommandMessage
impl UnwindSafe for CommandMessage
Blanket Implementations§
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
Mutably borrows from an owned value. Read more