response_time_analysis/supply/
dedicated.rs

1use super::SupplyBound;
2use crate::time::{Duration, Service};
3
4/// A trivial model to represent a 100%-available, dedicated processor.
5///
6/// There are no delays due to resource unavailability under this model.
7#[derive(Debug, Clone, Copy, Default)]
8pub struct Dedicated {
9    // nothing to define here
10}
11
12impl Dedicated {
13    /// Construct a new dedicated processor dummy.
14    pub fn new() -> Dedicated {
15        Dedicated {}
16    }
17}
18
19impl SupplyBound for Dedicated {
20    fn provided_service(&self, delta: Duration) -> Service {
21        Service::from(delta)
22    }
23
24    fn service_time(&self, demand: Service) -> Duration {
25        Duration::from(demand)
26    }
27}