pub trait Dialect:
Sized
+ MessageSpec
+ IntoPayload
+ Sync
+ Send {
// Required methods
fn name() -> &'static str;
fn dialect() -> Option<u32>;
fn version() -> Option<u8>;
fn message_info(id: u32) -> Result<&'static dyn MessageSpec, SpecError>;
fn decode(payload: &Payload) -> Result<Self, SpecError>;
fn spec() -> &'static DialectSpec;
}Expand description
Interface for autogenerated or custom MAVLink dialect specification.
Required Methods§
Sourcefn dialect() -> Option<u32>
fn dialect() -> Option<u32>
Returns dialect identifier as specified in MAVLink XML definitions.
Sourcefn version() -> Option<u8>
fn version() -> Option<u8>
Minor dialect version as specified in MAVLink XML definitions.
Corresponds to uint8_t_mavlink_version.
Dialect version appears in some messages like HEARTBEAT. In such cases it is usually not directly set by user.
Sourcefn message_info(id: u32) -> Result<&'static dyn MessageSpec, SpecError>
fn message_info(id: u32) -> Result<&'static dyn MessageSpec, SpecError>
Message specification by id.
Clients may access this method to retrieve message specification prior to decoding it from payload.
§Errors
Returns SpecError::NotInDialect if message with specified ID is not supported.
Sourcefn spec() -> &'static DialectSpec
fn spec() -> &'static DialectSpec
Dialect 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.