#[non_exhaustive]pub struct ArgumentSpec {
pub name: String,
pub description: Option<String>,
pub labels: Vec<ArgumentLabel>,
pub required: bool,
pub source: ArgumentSource,
pub shape: ValueShape,
pub names_the_record: bool,
}Expand description
One argument of an operation.
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.name: StringIts name among the arguments’ top-level fields.
description: Option<String>What it is, from the argument type’s documentation unless replaced.
labels: Vec<ArgumentLabel>The words people use for it. Hints for the model, never matched by code.
required: boolWhether an act cannot run without it.
source: ArgumentSourceWhere its value comes from.
shape: ValueShapeThe shape a model gives its value.
names_the_record: boolWhether its value names the record the operation creates, for the acts of the same turn that point at that record before it has a label.
Implementations§
Source§impl ArgumentSpec
impl ArgumentSpec
Sourcepub fn new(name: impl Into<String>, shape: ValueShape) -> Self
pub fn new(name: impl Into<String>, shape: ValueShape) -> Self
An argument named name of shape, user-sourced and optional.
Sourcepub fn label(self, text: impl Into<String>) -> Self
pub fn label(self, text: impl Into<String>) -> Self
Adds a word people use for it, in every language.
Sourcepub fn label_in(
self,
locale: impl Into<Locale>,
text: impl Into<String>,
) -> Self
pub fn label_in( self, locale: impl Into<Locale>, text: impl Into<String>, ) -> Self
Adds a word people use for it in locale.
Sourcepub const fn names_the_record(self) -> Self
pub const fn names_the_record(self) -> Self
Says its value names the record the operation creates.
Sourcepub fn from_read(self, read: impl Into<ReadToolKey>) -> Self
pub fn from_read(self, read: impl Into<ReadToolKey>) -> Self
Fills it from read after the plan exists.
Sourcepub fn written(self) -> Self
pub fn written(self) -> Self
Lets the model phrase a text value instead of selecting the user’s words.
Sourcepub fn date_direction(self, direction: DateDirection) -> Self
pub fn date_direction(self, direction: DateDirection) -> Self
Points a date without a year in direction.
Sourcepub fn record(self, workflow: impl Into<WorkflowKey>) -> Self
pub fn record(self, workflow: impl Into<WorkflowKey>) -> Self
Gives it as a record of workflow. The operation receives the record’s
CaseRef fields, with label when the record was in
view, or, for one the same turn opens, the value of the opening operation’s
argument that names it. A record named but not in view is looked
up in the case directory, and asked for again when none or several match.
Sourcepub fn labels_for<'a>(
&'a self,
locale: &'a Locale,
) -> impl Iterator<Item = &'a str> + 'a
pub fn labels_for<'a>( &'a self, locale: &'a Locale, ) -> impl Iterator<Item = &'a str> + 'a
The labels that apply in locale: its own ones first, then the universal ones.
Trait Implementations§
Source§impl Clone for ArgumentSpec
impl Clone for ArgumentSpec
Source§impl Debug for ArgumentSpec
impl Debug for ArgumentSpec
Source§impl<'de> Deserialize<'de> for ArgumentSpec
impl<'de> Deserialize<'de> for ArgumentSpec
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 ArgumentSpec
Source§impl PartialEq for ArgumentSpec
impl PartialEq for ArgumentSpec
Source§impl Serialize for ArgumentSpec
impl Serialize for ArgumentSpec
impl StructuralPartialEq for ArgumentSpec
Auto Trait Implementations§
impl Freeze for ArgumentSpec
impl RefUnwindSafe for ArgumentSpec
impl Send for ArgumentSpec
impl Sync for ArgumentSpec
impl Unpin for ArgumentSpec
impl UnsafeUnpin for ArgumentSpec
impl UnwindSafe for ArgumentSpec
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.