Trait GlobalMode

Source
pub trait GlobalMode: Sync + Send {
Show 16 methods // Required methods fn type_name(&self) -> &'static str; fn init_mode<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn exec_task_wait<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, due: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = WaitExitSignal> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn exec_task<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, task: Task, ) -> Pin<Box<dyn Future<Output = ExecExitSignal> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn safe_handler<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn zo_handler<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 Arc<ModeContext>, obj: KnownImgObjective, ) -> Pin<Box<dyn Future<Output = Option<OpExitSignal>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn bo_event_handler<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = Option<OpExitSignal>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn exit_mode<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = Box<dyn GlobalMode>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn safe_mode_rationale(&self) -> &'static str { ... } fn new_zo_rationale(&self) -> &'static str { ... } fn new_bo_rationale(&self) -> &'static str { ... } fn tasks_done_rationale(&self) -> &'static str { ... } fn tasks_done_exit_rationale(&self) -> &'static str { ... } fn out_of_orbit_rationale(&self) -> &'static str { ... } fn bo_done_rationale(&self) -> &'static str { ... } fn exec_task_queue<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Trait representing a high-level operational mode within the onboard Finite-State-Machine (FSM) architecture. Implementors of GlobalMode encapsulate full behavioral logic for mode-specific task scheduling, signal handling, and state transitions.

Required Methods§

Source

fn type_name(&self) -> &'static str

Returns the string representation of the current mode.

Source

fn init_mode<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initializes the mode with the provided context.

§Arguments
  • context - Shared reference to the current mode context.
§Returns

OpExitSignal - Signal indicating what action to take after initialization.

Source

fn exec_task_wait<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, due: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = WaitExitSignal> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits until a task’s due time or handles early exit signals while executing a wait primitive.

§Arguments
  • context - Shared reference to the mode context.
  • due - Scheduled task start time.
§Returns
  • WaitExitSignal - Resulting signal from monitoring exit conditions.
Source

fn exec_task<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, task: Task, ) -> Pin<Box<dyn Future<Output = ExecExitSignal> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes a single task and returns a signal indicating whether to continue or exit.

§Arguments
  • context - Shared reference to the mode context.
  • task - Task to be executed.
§Returns
  • ExecExitSignal - Resulting signal after task execution.
Source

fn safe_handler<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles unplanned safe mode transition.

§Arguments
  • context - Shared reference to the mode context.
§Returns
  • OpExitSignal - Signal after executing safe-mode exit logic.
Source

fn zo_handler<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 Arc<ModeContext>, obj: KnownImgObjective, ) -> Pin<Box<dyn Future<Output = Option<OpExitSignal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handles the reception of a new Zoned Objective (ZO).

§Arguments
  • context - Shared reference to the mode context.
  • obj - The new KnownImgObjective that triggered the transition.
§Returns
  • OptOpExitSignal - Optional signal indicating a mode switch or continuation.
Source

fn bo_event_handler<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = Option<OpExitSignal>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handles beacon-related events (e.g., mode changes or new signals).

§Arguments
  • context - Shared reference to the mode context.
§Returns
  • OptOpExitSignal - Optional signal indicating a mode switch or continuation.
Source

fn exit_mode<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = Box<dyn GlobalMode>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles cleanup and transition logic when exiting a mode.

§Arguments
  • context - Shared reference to the mode context.
§Returns
  • Box<dyn GlobalMode> - The next mode to transition into.

Provided Methods§

Source

fn safe_mode_rationale(&self) -> &'static str

Returns the rationale string for finishing the current phase due to safe mode entry.

Source

fn new_zo_rationale(&self) -> &'static str

Returns the rationale string for finishing the current phase due to a new Zoned Objective.

Source

fn new_bo_rationale(&self) -> &'static str

Returns the rationale string for finishing the current phase due to a new Beacon Objective.

Source

fn tasks_done_rationale(&self) -> &'static str

Returns the rationale string used when the task queue has completed.

Source

fn tasks_done_exit_rationale(&self) -> &'static str

Returns the rationale for finishing the task queue and exiting the orbit for ZO Retrieval.

Source

fn out_of_orbit_rationale(&self) -> &'static str

Returns the rationale for finishing the current phase due to being outside of orbit without a valid reason.

Source

fn bo_done_rationale(&self) -> &'static str

Returns the rationale used for finishing the current phase when a beacon objective has been completed or expired.

Source

fn exec_task_queue<'life0, 'async_trait>( &'life0 self, context: Arc<ModeContext>, ) -> Pin<Box<dyn Future<Output = OpExitSignal> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Executes all tasks in the current task queue in sequence. Waits for each task’s scheduled time and handles early exit signals such as safe transitions or new objectives.

§Arguments
  • context - Shared reference to the current mode context.
§Returns
  • OpExitSignal - Signal indicating whether to continue or exit the mode.

Implementors§