pub struct Server<'a> {
pub tasks: &'a [Task],
pub properties: ServerProperties,
}Expand description
Type Representing a Server with a given set of tasks, a capacity for fulfilling demand, a replenishment interval for how often the capacity is restored ,and a server type determining if the capacity is available only at the beginning of the interval or until it is used up
Fields§
§tasks: &'a [Task]The Tasks that produce Demand for this Server Sorted by priority with lower index equalling higher priority
properties: ServerPropertiesThe properties of the Server
Implementations§
Source§impl<'a> Server<'a>
impl<'a> Server<'a>
Sourcepub const fn new(
tasks: &'a [Task],
capacity: TimeUnit,
interval: TimeUnit,
server_type: ServerKind,
) -> Self
pub const fn new( tasks: &'a [Task], capacity: TimeUnit, interval: TimeUnit, server_type: ServerKind, ) -> Self
Create a new Server with the given Tasks and properties
Sourcepub const fn as_tasks(&self) -> &'a [Task]
pub const fn as_tasks(&self) -> &'a [Task]
Get a a reference to a slice of the Servers contained Tasks
Sourcepub fn aggregated_demand_curve_iter(
&self,
) -> impl CurveIterator<CurveKind = AggregatedServerDemand> + Clone + '_
pub fn aggregated_demand_curve_iter( &self, ) -> impl CurveIterator<CurveKind = AggregatedServerDemand> + Clone + '_
Calculate the aggregated demand Curve of a given Server up to a specified limit As defined in Definition 11. in the paper
Sourcepub fn constraint_demand_curve_iter(
&self,
) -> impl CurveIterator<CurveKind = ConstrainedServerDemand> + Clone + '_
pub fn constraint_demand_curve_iter( &self, ) -> impl CurveIterator<CurveKind = ConstrainedServerDemand> + Clone + '_
Calculate the constrained demand curve
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Server<'a>
impl<'a> RefUnwindSafe for Server<'a>
impl<'a> Send for Server<'a>
impl<'a> Sync for Server<'a>
impl<'a> Unpin for Server<'a>
impl<'a> UnwindSafe for Server<'a>
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
Mutably borrows from an owned value. Read more