pub trait MaybeVersioned: IsMagicByte + Clone + Debug + Sync + Send + Sealed + 'static {
    // Provided methods
    fn expect(version: MavLinkVersion) -> Result<(), VersionError> { ... }
    fn matches(version: MavLinkVersion) -> bool { ... }
}
Expand description

🔒 Marks structures which may or may not have a specified MAVLink protocol version.

âš  This trait is sealed âš 

For all such structures it is possible to call MaybeVersioned::expect and MaybeVersioned::matches to compare MAVLink version. The blanket implementation of MaybeVersioned assumes that everything is compatible by vacuous truth.

Provided Methods§

source

fn expect(version: MavLinkVersion) -> Result<(), VersionError>

Validates that provided frame matches MAVLink protocol version.

The blanket implementation will always return Ok meaning that everything is compatible.

source

fn matches(version: MavLinkVersion) -> bool

Checks that provided version of MAVLink protocol is compatible.

The blanket implementation will always return true meaning that everything is compatible.

Object Safety§

This trait is not object safe.

Implementors§