pub struct StateView {
pub state: EpisodeState,
pub terminal: bool,
pub may_move_to: Vec<EpisodeState>,
}Expand description
One state of the machine: its word, whether an episode ever leaves it, and where it may go from there.
use majordomus_cli::session::{EpisodeState, Machine, StateView};
let m = Machine::describe();
let closed: &StateView =
m.states.iter().find(|s| s.state == EpisodeState::Closed).expect("a state");
assert!(closed.terminal && closed.may_move_to.is_empty());Fields§
§state: EpisodeStateThe state’s word.
terminal: boolWhether an episode ever leaves it.
may_move_to: Vec<EpisodeState>The states an episode in this one may move to, in canonical order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StateView
impl<'de> Deserialize<'de> for StateView
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 StateView
Source§impl JsonSchema for StateView
impl JsonSchema for StateView
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for StateView
Auto Trait Implementations§
impl Freeze for StateView
impl RefUnwindSafe for StateView
impl Send for StateView
impl Sync for StateView
impl Unpin for StateView
impl UnsafeUnpin for StateView
impl UnwindSafe for StateView
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
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.