#[non_exhaustive]pub struct ActExpectation {
pub kind: ActKind,
pub operation: Option<String>,
pub or: Vec<ActExpectation>,
}Expand description
One expected normalized act.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ActKindThe act variant.
operation: Option<String>The operation, for the kinds that name one.
or: Vec<ActExpectation>Other shapes that satisfy this position just as well.
For the turns where more than one act is a CORRECT reading, which is not the same as a turn nobody decided about: a request may have two doors, and an expectation admitting one of them reports the other as a defect.
Not a way to assert less. Each alternative is a whole shape, written out and validated like the first, so a reader sees the closed set of readings somebody decided were right — never «any act will do».
Implementations§
Source§impl ActExpectation
impl ActExpectation
Sourcepub fn validate(&self) -> Result<(), CorpusError>
pub fn validate(&self) -> Result<(), CorpusError>
Checks the operation is one this kind can carry.
§Errors
CorpusError::Invalid when an operation is named on a kind that has
none — a mistake that would otherwise pass silently, because the
observed act has no operation to disagree with.
Trait Implementations§
Source§impl Clone for ActExpectation
impl Clone for ActExpectation
Source§impl Debug for ActExpectation
impl Debug for ActExpectation
Source§impl<'de> Deserialize<'de> for ActExpectation
impl<'de> Deserialize<'de> for ActExpectation
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>,
impl Eq for ActExpectation
Source§impl PartialEq for ActExpectation
impl PartialEq for ActExpectation
Source§impl Serialize for ActExpectation
impl Serialize for ActExpectation
impl StructuralPartialEq for ActExpectation
Auto Trait Implementations§
impl Freeze for ActExpectation
impl RefUnwindSafe for ActExpectation
impl Send for ActExpectation
impl Sync for ActExpectation
impl Unpin for ActExpectation
impl UnsafeUnpin for ActExpectation
impl UnwindSafe for ActExpectation
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.