pub struct TurnSpec {
pub text: Option<String>,
pub reply: Option<CardReplySpec>,
pub origin: Option<OriginSpec>,
pub user_id: Option<String>,
pub locale: Option<Locale>,
pub external: Option<ExternalSpec>,
}Expand description
The turn the person takes (spec §9: text and a card answer may coexist).
Fields§
§text: Option<String>What the person typed.
reply: Option<CardReplySpec>The card they clicked, named by the case it belongs to rather than by an identifier no file could know in advance.
origin: Option<OriginSpec>The origin token a surface issued (spec §12.4).
user_id: Option<String>The user within the tenant. The tenant itself is the harness’s business.
locale: Option<Locale>Locale of the person.
external: Option<ExternalSpec>A change from outside the conversation, taken in place of a person’s turn.
Implementations§
Source§impl TurnSpec
impl TurnSpec
Sourcepub fn validate(&self) -> Result<(), CorpusError>
pub fn validate(&self) -> Result<(), CorpusError>
Checks the turn carries something.
§Errors
CorpusError::Invalid when neither text nor a card answer is present, or
when an outside change carries anything a person would.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TurnSpec
impl<'de> Deserialize<'de> for TurnSpec
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 StructuralPartialEq for TurnSpec
Auto Trait Implementations§
impl Freeze for TurnSpec
impl RefUnwindSafe for TurnSpec
impl Send for TurnSpec
impl Sync for TurnSpec
impl Unpin for TurnSpec
impl UnsafeUnpin for TurnSpec
impl UnwindSafe for TurnSpec
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