Skip to main content

MaintenancePermit

Struct MaintenancePermit 

Source
pub struct MaintenancePermit<'turn, 'd> { /* private fields */ }
Expand description

Affine proof that one maintenance transition was admitted in this turn.

The permit has no runtime storage. Its invariant driver lifetime prevents a transition admitted by one driver from being used with another, while the turn lifetime prevents the proof from escaping the active scheduler turn.

ⓘ
use dope_core::driver::{self, schedule};

fn escape_driver<'turn, 'outer, 'inner>(
    work: schedule::Maintenance<'turn, 'outer>,
    _inner: driver::Reference<'inner>,
) -> schedule::MaintenancePermit<'turn, 'inner> {
    schedule::MaintenancePermit::try_take(work).unwrap()
}
ⓘ
use dope_core::driver::schedule;

fn escape_turn<'turn, 'd>(
    work: schedule::Maintenance<'turn, 'd>,
) -> schedule::MaintenancePermit<'static, 'd> {
    schedule::MaintenancePermit::try_take(work).unwrap()
}

Implementations§

Source§

impl<'turn, 'd> MaintenancePermit<'turn, 'd>

Source

pub fn try_take(work: Maintenance<'turn, 'd>) -> Option<Self>

Auto Trait Implementations§

§

impl<'turn, 'd> !UnwindSafe for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> Freeze for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> RefUnwindSafe for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> Send for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> Sync for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> Unpin for MaintenancePermit<'turn, 'd>

§

impl<'turn, 'd> UnsafeUnpin for MaintenancePermit<'turn, 'd>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.