diff --git a/satrs-core/src/pus/scheduler.rs b/satrs-core/src/pus/scheduler.rs index a2ce7fe..e55028c 100644 --- a/satrs-core/src/pus/scheduler.rs +++ b/satrs-core/src/pus/scheduler.rs @@ -238,7 +238,8 @@ impl Error for ScheduleError { } } -pub trait PusSchedulerInterface { +/// Generic trait for scheduler objects which are able to schedule ECSS PUS C packets. +pub trait PusSchedulerProvider { type TimeProvider: CcsdsTimeProvider + TimeReader; fn reset(&mut self, store: &mut (impl PoolProvider + ?Sized)) -> Result<(), StoreError>; @@ -782,7 +783,7 @@ pub mod alloc_mod { } } - impl PusSchedulerInterface for PusScheduler { + impl PusSchedulerProvider for PusScheduler { type TimeProvider = cds::TimeProvider; /// This will disable the scheduler and clear the schedule as specified in 6.11.4.4. diff --git a/satrs-core/src/pus/scheduler_srv.rs b/satrs-core/src/pus/scheduler_srv.rs index 18f1b58..8976143 100644 --- a/satrs-core/src/pus/scheduler_srv.rs +++ b/satrs-core/src/pus/scheduler_srv.rs @@ -1,4 +1,4 @@ -use super::scheduler::PusSchedulerInterface; +use super::scheduler::PusSchedulerProvider; use super::{EcssTcInMemConverter, PusServiceBase, PusServiceHelper}; use crate::pool::PoolProvider; use crate::pus::{PusPacketHandlerResult, PusPacketHandlingError}; @@ -16,13 +16,13 @@ use spacepackets::time::cds::TimeProvider; /// telecommands when applicable. pub struct PusService11SchedHandler< TcInMemConverter: EcssTcInMemConverter, - Scheduler: PusSchedulerInterface, + PusScheduler: PusSchedulerProvider, > { pub service_helper: PusServiceHelper, - scheduler: Scheduler, + scheduler: PusScheduler, } -impl +impl PusService11SchedHandler { pub fn new(service_helper: PusServiceHelper, scheduler: Scheduler) -> Self { @@ -173,7 +173,7 @@ mod tests { use crate::pool::{StaticMemoryPool, StaticPoolConfig}; use crate::pus::tests::TEST_APID; use crate::pus::{ - scheduler::{self, PusSchedulerInterface, TcInfo}, + scheduler::{self, PusSchedulerProvider, TcInfo}, tests::{PusServiceHandlerWithSharedStoreCommon, PusTestHarness}, verification::{RequestId, TcStateAccepted, VerificationToken}, EcssTcInSharedStoreConverter, @@ -232,7 +232,7 @@ mod tests { inserted_tcs: VecDeque, } - impl PusSchedulerInterface for TestScheduler { + impl PusSchedulerProvider for TestScheduler { type TimeProvider = cds::TimeProvider; fn reset(