Skip to main content

WriteEngine

Struct WriteEngine 

Source
pub struct WriteEngine { /* private fields */ }
Expand description

Write engine for temporal operations.

Implementations§

Source§

impl WriteEngine

Source

pub fn new(file: TimeFile) -> Self

Create a new write engine wrapping a TimeFile.

Source

pub fn into_file(self) -> TimeFile

Consume the engine, returning the underlying TimeFile.

Source

pub fn file(&self) -> &TimeFile

Get a reference to the underlying TimeFile.

Source

pub fn file_mut(&mut self) -> &mut TimeFile

Get a mutable reference to the underlying TimeFile.

Source

pub fn add_duration( &mut self, duration: DurationEstimate, ) -> TimeResult<TemporalId>

Add a duration estimate.

Source

pub fn update_duration(&mut self, duration: DurationEstimate) -> TimeResult<()>

Update an existing duration estimate.

Source

pub fn add_deadline(&mut self, deadline: Deadline) -> TimeResult<TemporalId>

Add a deadline.

Source

pub fn update_deadline(&mut self, deadline: Deadline) -> TimeResult<()>

Update an existing deadline.

Source

pub fn complete_deadline(&mut self, id: &TemporalId) -> TimeResult<()>

Complete a deadline.

Source

pub fn cancel_deadline(&mut self, id: &TemporalId) -> TimeResult<()>

Cancel a deadline.

Source

pub fn add_schedule(&mut self, schedule: Schedule) -> TimeResult<TemporalId>

Add a schedule. Returns error if it conflicts with existing non-flexible schedules.

Source

pub fn update_schedule(&mut self, schedule: Schedule) -> TimeResult<()>

Update an existing schedule.

Source

pub fn reschedule( &mut self, id: &TemporalId, new_start: DateTime<Utc>, ) -> TimeResult<()>

Reschedule to a new start time.

Source

pub fn add_sequence(&mut self, sequence: Sequence) -> TimeResult<TemporalId>

Add a sequence.

Source

pub fn update_sequence(&mut self, sequence: Sequence) -> TimeResult<()>

Update an existing sequence.

Source

pub fn advance_sequence(&mut self, id: &TemporalId) -> TimeResult<()>

Advance a sequence to the next step.

Source

pub fn add_decay(&mut self, decay: DecayModel) -> TimeResult<TemporalId>

Add a decay model.

Source

pub fn update_decay(&mut self, decay: DecayModel) -> TimeResult<()>

Update an existing decay model.

Source

pub fn refresh_decay(&mut self, id: &TemporalId) -> TimeResult<f64>

Refresh a decay model (recalculate current value).

Source

pub fn update_all_statuses(&mut self) -> TimeResult<UpdateReport>

Update all statuses (deadlines + decays) based on current time.

Auto Trait Implementations§

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.