pub struct ConfigFunction {
pub returns: Option<ValidationType>,
pub parameters: Option<IndexMap<String, SchemaAttribute>>,
pub transform: Option<FunctionTransformHook>,
pub validate: Option<FunctionValidateHook>,
}Expand description
A function a document may call in an attribute value.
Mirrors upstream’s ConfigFunction. Both hooks are synchronous; see
DIVERGENCES.md entry 3.
Fields§
§returns: Option<ValidationType>What the call returns, used to type-check the attribute it feeds.
Checked only when ValidationOptions::validate_functions is on.
parameters: Option<IndexMap<String, SchemaAttribute>>The declared parameters, keyed as the call sites key them.
None means the function declares no parameters and none are checked;
Some of an empty map means every parameter passed is invalid. A
positional argument is keyed by its decimal index – see
Function::positional_key –
which is why this is a string-keyed map rather than a list.
transform: Option<FunctionTransformHook>Turns a call into a value at transform time.
validate: Option<FunctionValidateHook>Reports problems with a call beyond what the parameter declarations catch.
Trait Implementations§
Source§impl Clone for ConfigFunction
impl Clone for ConfigFunction
Source§fn clone(&self) -> ConfigFunction
fn clone(&self) -> ConfigFunction
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 ConfigFunction
impl Debug for ConfigFunction
Source§impl Default for ConfigFunction
impl Default for ConfigFunction
Source§fn default() -> ConfigFunction
fn default() -> ConfigFunction
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ConfigFunction
impl !UnwindSafe for ConfigFunction
impl Freeze for ConfigFunction
impl Send for ConfigFunction
impl Sync for ConfigFunction
impl Unpin for ConfigFunction
impl UnsafeUnpin for ConfigFunction
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