pub(super) trait OrbitalMode: GlobalMode {
// Required method
fn base(&self) -> &BaseMode;
// Provided methods
fn get_max_dt() -> TimeDelta { ... }
async fn exec_task_wait(
&self,
context: Arc<ModeContext>,
due: DateTime<Utc>,
) -> WaitExitSignal { ... }
async fn monitor_bo_mon_change(
sig: BeaconControllerState,
bo_mon: &RwLock<Receiver<BeaconControllerState>>,
) { ... }
async fn log_bo_event(&self, context: &Arc<ModeContext>, base: BaseMode) { ... }
}Expand description
An internal extension trait for GlobalMode that encapsulates logic specific to
time-constrained orbital task execution.
The OrbitalMode trait provides utility methods for task waiting, event monitoring,
and logging transitions related to orbital activities, such as beacon detection or
zoned objective events.
This trait is not intended to be used directly outside the mode control subsystem.
Required Methods§
Provided Methods§
Sourcefn get_max_dt() -> TimeDelta
fn get_max_dt() -> TimeDelta
Sourceasync fn exec_task_wait(
&self,
context: Arc<ModeContext>,
due: DateTime<Utc>,
) -> WaitExitSignal
async fn exec_task_wait( &self, context: Arc<ModeContext>, due: DateTime<Utc>, ) -> WaitExitSignal
Waits until a scheduled task’s due time or returns early if a notable event occurs.
While waiting, this method concurrently monitors for:
- Safe mode triggers
- New zoned objectives (ZO)
- Beacon state changes (BO)
It also supports short or long sleep strategies depending on how far the task lies in the future.
§Arguments
context– Shared reference to the currentModeContext.due– Scheduled time at which the next task is expected to start.
§Returns
WaitExitSignal– An event indicating why the wait ended (safe event, ZO, or BO, …).
Sourceasync fn monitor_bo_mon_change(
sig: BeaconControllerState,
bo_mon: &RwLock<Receiver<BeaconControllerState>>,
)
async fn monitor_bo_mon_change( sig: BeaconControllerState, bo_mon: &RwLock<Receiver<BeaconControllerState>>, )
Continuously monitors the BeaconControllerState until it changes to the expected value.
Used to react to asynchronous events in which the beacon scanning mode (e.g., active or inactive) must trigger a response in the scheduler or mode transition logic.
§Arguments
sig– TheBeaconControllerStatestate to wait for.bo_mon– A watch receiver providing asynchronous access to beacon state changes.
Sourceasync fn log_bo_event(&self, context: &Arc<ModeContext>, base: BaseMode)
async fn log_bo_event(&self, context: &Arc<ModeContext>, base: BaseMode)
Logs a beacon-related event and finalizes the orbit at the current satellite position.
This is used to capture the reason for switching out of the current BaseMode,
typically due to either beacon objective completion or expiry.
§Arguments
context– Shared reference to the currentModeContext.base– TheBaseModethat determines the rationale for finishing the orbit segment.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.