pub struct DeferredAct {
pub act: UnderstoodAct,
pub case_ref: Option<CaseRef>,
}Expand description
The act a card is guarding, persisted with the card.
Fields§
§act: UnderstoodActThe act as it was understood. Its target is replaced when it is resumed.
case_ref: Option<CaseRef>The case the act was aimed at, when the turn already knew it; None for a
selection card, whose answer supplies it.
Implementations§
Source§impl DeferredAct
impl DeferredAct
Sourcepub const fn unbound(act: UnderstoodAct) -> Self
pub const fn unbound(act: UnderstoodAct) -> Self
An act whose target the answer will supply.
Sourcepub const fn on(act: UnderstoodAct, case_ref: CaseRef) -> Self
pub const fn on(act: UnderstoodAct, case_ref: CaseRef) -> Self
An act already aimed at a case, waiting only for a yes.
Sourcepub fn attach_to(&self, payload: InteractionPayload) -> InteractionPayload
pub fn attach_to(&self, payload: InteractionPayload) -> InteractionPayload
Writes the deferred act into a card payload. Metadata that is neither absent nor a JSON object is the application’s own, and is left alone.
Sourcepub fn of(payload: &InteractionPayload) -> Option<Self>
pub fn of(payload: &InteractionPayload) -> Option<Self>
Reads the deferred act back, when the card carries one.
Trait Implementations§
Source§impl Clone for DeferredAct
impl Clone for DeferredAct
Source§impl Debug for DeferredAct
impl Debug for DeferredAct
Source§impl<'de> Deserialize<'de> for DeferredAct
impl<'de> Deserialize<'de> for DeferredAct
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 DeferredAct
Source§impl PartialEq for DeferredAct
impl PartialEq for DeferredAct
Source§impl Serialize for DeferredAct
impl Serialize for DeferredAct
impl StructuralPartialEq for DeferredAct
Auto Trait Implementations§
impl Freeze for DeferredAct
impl RefUnwindSafe for DeferredAct
impl Send for DeferredAct
impl Sync for DeferredAct
impl Unpin for DeferredAct
impl UnsafeUnpin for DeferredAct
impl UnwindSafe for DeferredAct
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>,
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.