pub trait Message: Sized {
// Required methods
fn message_type() -> &'static str;
fn encode_content(&self) -> Result<Vec<u8>>;
fn decode_content(data: &[u8]) -> Result<Self>;
}
Expand description
Common interface for all OpenIGTLink message types
Each message type (TRANSFORM, IMAGE, STATUS, etc.) must implement this trait to provide encoding/decoding functionality.
Required Methods§
Sourcefn message_type() -> &'static str
fn message_type() -> &'static str
Returns the message type name (e.g., “TRANSFORM”, “IMAGE”)
This must match the OpenIGTLink protocol specification.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.