pub struct FunctionDescriptor {Show 18 fields
pub id: String,
pub module: String,
pub version: String,
pub title: String,
pub summary: String,
pub description: String,
pub parameters: Vec<ParamDescriptor>,
pub output: ValueSchema,
pub output_description: String,
pub modes: Vec<NumericMode>,
pub purity: Purity,
pub determinism: Determinism,
pub cost: CostClass,
pub units_rule: String,
pub method_ref: String,
pub examples: Vec<Example>,
pub deprecated: Option<Deprecation>,
pub tags: Vec<String>,
}Expand description
The authoritative function declaration.
Fields§
§id: String§module: String§version: String§title: String§summary: String§description: String§parameters: Vec<ParamDescriptor>§output: ValueSchema§output_description: String§modes: Vec<NumericMode>§purity: Purity§determinism: Determinism§cost: CostClass§units_rule: String§method_ref: String§examples: Vec<Example>§deprecated: Option<Deprecation>Implementations§
Source§impl FunctionDescriptor
impl FunctionDescriptor
pub fn new( id: impl Into<String>, module: impl Into<String>, version: impl Into<String>, title: impl Into<String>, summary: impl Into<String>, ) -> FunctionDescriptor
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_parameters(self, parameters: Vec<ParamDescriptor>) -> Self
pub fn with_output( self, output: ValueSchema, description: impl Into<String>, ) -> Self
pub fn with_modes(self, modes: impl IntoIterator<Item = NumericMode>) -> Self
pub fn with_cost(self, cost: CostClass) -> Self
pub fn with_units_rule(self, rule: impl Into<String>) -> Self
pub fn with_method_ref(self, method_ref: impl Into<String>) -> Self
pub fn with_examples(self, examples: Vec<Example>) -> Self
pub fn with_deprecation(self, deprecation: Deprecation) -> Self
pub fn parameter(&self, name: &str) -> Option<&ParamDescriptor>
Trait Implementations§
Source§impl Clone for FunctionDescriptor
impl Clone for FunctionDescriptor
Source§fn clone(&self) -> FunctionDescriptor
fn clone(&self) -> FunctionDescriptor
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 FunctionDescriptor
impl Debug for FunctionDescriptor
Source§impl<'de> Deserialize<'de> for FunctionDescriptor
impl<'de> Deserialize<'de> for FunctionDescriptor
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 FunctionDescriptor
impl PartialEq for FunctionDescriptor
Source§impl Serialize for FunctionDescriptor
impl Serialize for FunctionDescriptor
impl StructuralPartialEq for FunctionDescriptor
Auto Trait Implementations§
impl Freeze for FunctionDescriptor
impl RefUnwindSafe for FunctionDescriptor
impl Send for FunctionDescriptor
impl Sync for FunctionDescriptor
impl Unpin for FunctionDescriptor
impl UnsafeUnpin for FunctionDescriptor
impl UnwindSafe for FunctionDescriptor
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