#[non_exhaustive]pub struct FunctionDescriptor {
pub lang: String,
pub body: String,
pub inputs: Vec<String>,
pub signature: Signature,
pub order: Option<Vec<String>>,
pub extents: BTreeMap<String, Extent>,
}Expand description
A function descriptor (7) with the optional members of spec-0.4.0: signature.order
and argument extent. Absent, it is the Descriptor of spec-0.3.0, byte for byte and
hash for hash (From<Descriptor>, to_descriptor).
The fields are public to read; a value changed by hand is not checked again until it is
parsed: FunctionDescriptor::from_value(&d.to_value()) checks it.
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.lang: Stringcode.lang, e.g. stored or formula.
body: Stringcode.body, opaque to this crate.
inputs: Vec<String>Fully qualified names of the functions this one may read, ascending.
signature: Signature§order: Option<Vec<String>>signature.order: every argument name exactly once, the order positional arguments
bind in (15.5); None when absent.
extents: BTreeMap<String, Extent>The arguments’ extent members, by argument name; empty when none has one.
Implementations§
Source§impl FunctionDescriptor
impl FunctionDescriptor
Sourcepub fn from_json(bytes: &[u8]) -> Result<FunctionDescriptor>
pub fn from_json(bytes: &[u8]) -> Result<FunctionDescriptor>
Parses a descriptor from JSON text: strict JSON, structure, canonical form (7), with
order and extent and their checks (E_SCHEMA for their shapes, E_CANON_SET,
E_CANON_TYPE, E_CANON_NUMBER, E_CANON_LIMIT and the lexical codes otherwise).
Sourcepub fn from_value(v: &Value) -> Result<FunctionDescriptor>
pub fn from_value(v: &Value) -> Result<FunctionDescriptor>
Checks a parsed JSON value as a descriptor.
Sourcepub fn to_descriptor(&self) -> Option<Descriptor>
pub fn to_descriptor(&self) -> Option<Descriptor>
The spec-0.3.0 form, when there is no order and no extent.
Sourcepub fn resolve_unit(&self, cell: &Cell) -> Result<Option<String>>
pub fn resolve_unit(&self, cell: &Cell) -> Result<Option<String>>
The unit of cell’s value (7.1, units.md 3), as resolve_with does for a
Descriptor; None when the function does not return a number.