#[non_exhaustive]pub struct OpenCard {
pub workflow: WorkflowKey,
pub record: Option<TargetToken>,
pub question: String,
pub options: Vec<CardOption>,
pub accepts_typed_answer: bool,
}Expand description
The card on screen, as its question and option labels.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workflow: WorkflowKeyThe workflow it belongs to.
record: Option<TargetToken>The record it is about.
question: StringIts question.
options: Vec<CardOption>Its options.
accepts_typed_answer: boolWhether typed text may answer it at all.
Implementations§
Source§impl OpenCard
impl OpenCard
Sourcepub fn new(
workflow: impl Into<WorkflowKey>,
question: impl Into<String>,
) -> Self
pub fn new( workflow: impl Into<WorkflowKey>, question: impl Into<String>, ) -> Self
A card asking question about a record of workflow.
Sourcepub fn about(self, record: impl Into<TargetToken>) -> Self
pub fn about(self, record: impl Into<TargetToken>) -> Self
Sets the record it is about.
Sourcepub const fn click_only(self) -> Self
pub const fn click_only(self) -> Self
Refuses typed answers: only a click resolves it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OpenCard
impl RefUnwindSafe for OpenCard
impl Send for OpenCard
impl Sync for OpenCard
impl Unpin for OpenCard
impl UnsafeUnpin for OpenCard
impl UnwindSafe for OpenCard
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