pub struct Plan {
pub steps: Vec<Step>,
pub current: Option<usize>,
pub revision: u64,
pub transitions: Vec<PlanTransition>,
}Expand description
Current state and complete history, restored with the service.
Fields§
§steps: Vec<Step>Steps in ordinal order.
current: Option<usize>The sole doing step’s id, or none.
revision: u64Increases once for each accepted write.
transitions: Vec<PlanTransition>Every accepted write, oldest first.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn validate(&self, limits: &SiteLimits) -> Result<(), SiteError>
pub fn validate(&self, limits: &SiteLimits) -> Result<(), SiteError>
Validates the complete stored plan before any retained value is served.
§Errors
A configured bound, invalid ordinal, conflicting current or broken history.
Sourcepub fn set(
&mut self,
titles: &[String],
holder: &str,
at_ms: u64,
limits: &SiteLimits,
) -> Result<(), SiteError>
pub fn set( &mut self, titles: &[String], holder: &str, at_ms: u64, limits: &SiteLimits, ) -> Result<(), SiteError>
Replaces the list without removing or renaming any finished ordinal.
§Errors
A configured bound, invalid title or finished step change.
Sourcepub fn step(
&mut self,
id: usize,
status: StepStatus,
note: Option<String>,
holder: &str,
at_ms: u64,
limits: &SiteLimits,
) -> Result<(), SiteError>
pub fn step( &mut self, id: usize, status: StepStatus, note: Option<String>, holder: &str, at_ms: u64, limits: &SiteLimits, ) -> Result<(), SiteError>
Changes one step, preserving the single doing step and terminal completion.
§Errors
Unknown ordinal, invalid note, another doing step or a configured bound.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plan
impl<'de> Deserialize<'de> for Plan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Plan
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.