pub struct ParamDescriptor {
pub name: String,
pub description: String,
pub schema: ValueSchema,
pub required: bool,
pub numeric_shorthand: bool,
pub positional: bool,
}Expand description
A function parameter.
Fields§
§name: String§description: String§schema: ValueSchema§required: bool§numeric_shorthand: boolWhether a string may be used as a numeric shorthand for this parameter.
positional: boolWhether the parameter may be supplied positionally in expressions.
Implementations§
Source§impl ParamDescriptor
impl ParamDescriptor
pub fn required( name: impl Into<String>, description: impl Into<String>, schema: ValueSchema, ) -> ParamDescriptor
pub fn optional( name: impl Into<String>, description: impl Into<String>, schema: ValueSchema, ) -> ParamDescriptor
pub fn with_shorthand(self, allowed: bool) -> Self
pub fn with_positional(self, allowed: bool) -> Self
Trait Implementations§
Source§impl Clone for ParamDescriptor
impl Clone for ParamDescriptor
Source§fn clone(&self) -> ParamDescriptor
fn clone(&self) -> ParamDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParamDescriptor
impl Debug for ParamDescriptor
Source§impl<'de> Deserialize<'de> for ParamDescriptor
impl<'de> Deserialize<'de> for ParamDescriptor
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
Source§impl PartialEq for ParamDescriptor
impl PartialEq for ParamDescriptor
Source§impl Serialize for ParamDescriptor
impl Serialize for ParamDescriptor
impl StructuralPartialEq for ParamDescriptor
Auto Trait Implementations§
impl Freeze for ParamDescriptor
impl RefUnwindSafe for ParamDescriptor
impl Send for ParamDescriptor
impl Sync for ParamDescriptor
impl Unpin for ParamDescriptor
impl UnsafeUnpin for ParamDescriptor
impl UnwindSafe for ParamDescriptor
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