dope-sys 0.22.0

Typed operating-system call contracts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Budget;

/// A scheduler reservation retaining its exact turn, driver and lane brands.
pub trait Quota {
    type Budget<'a, Lane>: Budget
    where
        Self: 'a;

    fn remaining(&self) -> usize;
    fn share<const N: usize, const I: usize>(&self, cursor: usize) -> usize;
    fn budget<Lane>(&self, limit: usize) -> Self::Budget<'_, Lane>;

    /// Returns the reservation before work resumes outside this reactor scope.
    fn refund(self);
}