Struct mavspec_rust_spec::DialectSpec
source · pub struct DialectSpec { /* private fields */ }
Expand description
Dialect specification.
Implementations§
source§impl DialectSpec
impl DialectSpec
sourcepub const fn new(
name: &'static str,
dialect: Option<DialectId>,
version: Option<DialectVersion>,
messages_info: &'static [MessageInfo]
) -> Self
pub const fn new( name: &'static str, dialect: Option<DialectId>, version: Option<DialectVersion>, messages_info: &'static [MessageInfo] ) -> Self
Creates dialect specification.
sourcepub fn dialect(&self) -> Option<DialectId>
pub fn dialect(&self) -> Option<DialectId>
Returns dialect
identifier as specified in MAVLink XML definitions.
sourcepub fn version(&self) -> Option<DialectVersion>
pub fn version(&self) -> Option<DialectVersion>
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.
sourcepub fn message_info(&self, id: MessageId) -> Result<&MessageInfo, SpecError>
pub fn message_info(&self, id: MessageId) -> Result<&MessageInfo, 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.
Trait Implementations§
source§impl Clone for DialectSpec
impl Clone for DialectSpec
source§fn clone(&self) -> DialectSpec
fn clone(&self) -> DialectSpec
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for DialectSpec
impl RefUnwindSafe for DialectSpec
impl Send for DialectSpec
impl Sync for DialectSpec
impl Unpin for DialectSpec
impl UnwindSafe for DialectSpec
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