pub struct ModelView<'a> { /* private fields */ }Expand description
A borrowed view of one independently stateful model inside an execution unit.
The identity, state owner, and schema allocation must remain stable at the
same model index for the complete execution. complete and
target_iteration are declarations inspected by Workflow; constructing a
view has no side effects.
Implementations§
Source§impl<'a> ModelView<'a>
impl<'a> ModelView<'a>
Sourcepub const fn new(
identity: &'a str,
state: &'a SystemState,
complete: bool,
target_iteration: Option<u64>,
) -> Self
pub const fn new( identity: &'a str, state: &'a SystemState, complete: bool, target_iteration: Option<u64>, ) -> Self
Describes one model owned by an ExecutionUnit.
identity must be nonempty, contain no surrounding whitespace, and be
unique within the unit. state must remain at the same address and use
the schema supplied to ExecutionUnit::initialize. A target, when
present, must not precede the state’s current iteration.
Sourcepub const fn identity(self) -> &'a str
pub const fn identity(self) -> &'a str
Returns the stable identity of this model within its execution unit.
Sourcepub const fn state(self) -> &'a SystemState
pub const fn state(self) -> &'a SystemState
Borrows this model’s directly owned canonical state.
Sourcepub const fn is_complete(self) -> bool
pub const fn is_complete(self) -> bool
Returns whether this model requires no further transition.
Sourcepub const fn target_iteration(self) -> Option<u64>
pub const fn target_iteration(self) -> Option<u64>
Returns this model’s optional expected final iteration.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ModelView<'a>
impl<'a> !Send for ModelView<'a>
impl<'a> !Sync for ModelView<'a>
impl<'a> !UnwindSafe for ModelView<'a>
impl<'a> Freeze for ModelView<'a>
impl<'a> Unpin for ModelView<'a>
impl<'a> UnsafeUnpin for ModelView<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more