pub struct MissionPlan { /* private fields */ }Expand description
⍚ Mission plan for drones that support MAVLink mission
protocol.
Supports unofficial mission file format.
For no-alloc targets use no_alloc::MissionPlan.
Implementations§
Source§impl MissionPlan
impl MissionPlan
Sourcepub fn from_waypoints(waypoints: &[Waypoint]) -> Self
pub fn from_waypoints(waypoints: &[Waypoint]) -> Self
Constructs mission plan from the slice waypoints.
Sourcepub fn try_from_mission_planner_str(content: &str) -> Result<Self, MissionError>
pub fn try_from_mission_planner_str(content: &str) -> Result<Self, MissionError>
Attempts to construct mission plan from the contents of the mission file.
Sourcepub fn try_from_mission_planner_buf(buf: &[u8]) -> Result<Self, MissionError>
pub fn try_from_mission_planner_buf(buf: &[u8]) -> Result<Self, MissionError>
Attempts to construct mission plan from the binary contents of the mission file.
Sourcepub fn put(&mut self, waypoint: Waypoint) -> Option<u16>
pub fn put(&mut self, waypoint: Waypoint) -> Option<u16>
Puts waypoint into the mission plan.
This function will either insert a waypoint to an already existing position or append list of waypoints.
Sourcepub fn insert(&mut self, waypoint: Waypoint) -> Option<u16>
pub fn insert(&mut self, waypoint: Waypoint) -> Option<u16>
Inserts waypoint into the mission plan.
This function will insert a waypoint and adjust other waypoint positions accordingly. If the
index of a waypoint is greater than length of the current mission plan, it will be
ignored.
Trait Implementations§
Source§impl Clone for MissionPlan
impl Clone for MissionPlan
Source§fn clone(&self) -> MissionPlan
fn clone(&self) -> MissionPlan
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 MissionPlan
impl Debug for MissionPlan
Source§impl Default for MissionPlan
impl Default for MissionPlan
Source§impl<'de> Deserialize<'de> for MissionPlan
impl<'de> Deserialize<'de> for MissionPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MissionPlan
impl Display for MissionPlan
Source§impl From<&[Waypoint]> for MissionPlan
impl From<&[Waypoint]> for MissionPlan
Source§impl NamedType for MissionPlan
impl NamedType for MissionPlan
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
this is equivalent to Type::inline but returns a NamedDataType instead.
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
this is equivalent to [Type::definition] but returns a NamedDataType instead.
Source§impl Serialize for MissionPlan
impl Serialize for MissionPlan
Source§impl TryFrom<&[u8]> for MissionPlan
impl TryFrom<&[u8]> for MissionPlan
Source§impl TryFrom<&str> for MissionPlan
impl TryFrom<&str> for MissionPlan
Source§impl Type for MissionPlan
impl Type for MissionPlan
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Returns the definition of a type using the provided generics. Read more
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
Generates a datatype corresponding to a reference to this type,
as determined by its category. Getting a reference to a type implies that
it should belong in the type map (since it has to be referenced from somewhere),
so the output of
definition will be put into the type map.impl Flatten for MissionPlan
Auto Trait Implementations§
impl Freeze for MissionPlan
impl RefUnwindSafe for MissionPlan
impl Send for MissionPlan
impl Sync for MissionPlan
impl Unpin for MissionPlan
impl UnwindSafe for MissionPlan
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