pub struct ContractArg {
pub field: String,
pub long: String,
pub short: Option<char>,
pub position: Option<usize>,
pub kind: ArgKind,
pub required: bool,
pub help: Option<String>,
pub choices: Vec<String>,
}Expand description
One argument of one command.
Fields§
§field: StringParameter name as the command deserializes it, e.g. system_prompt.
This is what dispatch sends, whatever the caller typed.
long: StringLong spelling, without dashes, e.g. system-prompt.
short: Option<char>Short spelling, when the command declares one.
position: Option<usize>Position when this argument is also spelled as a bare word, 1-based.
kind: ArgKind§required: bool§help: Option<String>§choices: Vec<String>Declared values, surfaced so help lists them and a wrong one is corrected rather than dispatched.
Trait Implementations§
Source§impl Clone for ContractArg
impl Clone for ContractArg
Source§impl Debug for ContractArg
impl Debug for ContractArg
Source§impl<'de> Deserialize<'de> for ContractArg
impl<'de> Deserialize<'de> for ContractArg
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 ContractArg
Source§impl PartialEq for ContractArg
impl PartialEq for ContractArg
Source§impl Serialize for ContractArg
impl Serialize for ContractArg
impl StructuralPartialEq for ContractArg
Auto Trait Implementations§
impl Freeze for ContractArg
impl RefUnwindSafe for ContractArg
impl Send for ContractArg
impl Sync for ContractArg
impl Unpin for ContractArg
impl UnsafeUnpin for ContractArg
impl UnwindSafe for ContractArg
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