pub struct MissionTask {
pub task_id: String,
pub task_type: MissionTaskType,
pub issued_at: DateTime<Utc>,
pub issued_by: String,
pub expires_at: DateTime<Utc>,
pub target: Option<MissionTarget>,
pub boundary: Option<MissionBoundary>,
pub priority: MissionPriority,
pub objective_position: Option<Position>,
pub remarks: Option<String>,
}Expand description
Mission task from C2/TAK Server (Issue #318)
Represents a mission tasking command received from TAK Server. This is the Peat representation of CoT mission task events.
CoT Event Types handled:
t-x-m-c-c: Track target command → TrackTargett-x-m-c-s: Search area command → SearchAreat-x-m-c-a: Abort command → Abort
Fields§
§task_id: StringUnique task identifier (from CoT event@uid)
task_type: MissionTaskTypeMission type
issued_at: DateTime<Utc>When the task was issued (from CoT event@time)
issued_by: StringWho issued the task (CoT source UID or callsign)
expires_at: DateTime<Utc>When the task expires (from CoT event@stale)
target: Option<MissionTarget>Target information (for TRACK_TARGET missions)
boundary: Option<MissionBoundary>Boundary/area (for SEARCH_AREA, MONITOR_ZONE missions)
priority: MissionPriorityTask priority
objective_position: Option<Position>Objective location (from CoT point)
remarks: Option<String>Raw remarks from CoT (for additional context)
Implementations§
Source§impl MissionTask
impl MissionTask
Sourcepub fn new(
task_id: String,
task_type: MissionTaskType,
issued_by: String,
expires_at: DateTime<Utc>,
) -> Self
pub fn new( task_id: String, task_type: MissionTaskType, issued_by: String, expires_at: DateTime<Utc>, ) -> Self
Create a new mission task
Sourcepub fn from_cot_event(event: &CotEvent) -> Result<Self, MissionTaskError>
pub fn from_cot_event(event: &CotEvent) -> Result<Self, MissionTaskError>
Create from a CoT event (Issue #318)
Converts a mission-type CoT event to Peat MissionTask format.
Sourcepub fn with_target(self, target: MissionTarget) -> Self
pub fn with_target(self, target: MissionTarget) -> Self
Set target information
Sourcepub fn with_boundary(self, boundary: MissionBoundary) -> Self
pub fn with_boundary(self, boundary: MissionBoundary) -> Self
Set boundary
Sourcepub fn with_priority(self, priority: MissionPriority) -> Self
pub fn with_priority(self, priority: MissionPriority) -> Self
Set priority
Sourcepub fn with_objective_position(self, position: Position) -> Self
pub fn with_objective_position(self, position: Position) -> Self
Set objective position
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the mission is expired
Sourcepub fn is_mission_cot_type(cot_type: &str) -> bool
pub fn is_mission_cot_type(cot_type: &str) -> bool
Check if this is a mission-type CoT event
Trait Implementations§
Source§impl Clone for MissionTask
impl Clone for MissionTask
Source§fn clone(&self) -> MissionTask
fn clone(&self) -> MissionTask
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MissionTask
impl Debug for MissionTask
Source§impl<'de> Deserialize<'de> for MissionTask
impl<'de> Deserialize<'de> for MissionTask
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>,
Source§impl PartialEq for MissionTask
impl PartialEq for MissionTask
Source§impl Serialize for MissionTask
impl Serialize for MissionTask
impl StructuralPartialEq for MissionTask
Auto Trait Implementations§
impl Freeze for MissionTask
impl RefUnwindSafe for MissionTask
impl Send for MissionTask
impl Sync for MissionTask
impl Unpin for MissionTask
impl UnsafeUnpin for MissionTask
impl UnwindSafe for MissionTask
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more