pub enum FuncVal {
    Id,
    Normal(Cc<FuncDesc>),
    StaticBuiltin(&'static dyn StaticBuiltin),
    Builtin(Cc<TraceBox<dyn Builtin>>),
}
Expand description

Represents a Jsonnet function value, including plain functions and user-provided builtins.

Variants§

§

Id

Identity function, kept this way for comparsions.

§

Normal(Cc<FuncDesc>)

Plain function implemented in jsonnet.

§

StaticBuiltin(&'static dyn StaticBuiltin)

Standard library function.

§

Builtin(Cc<TraceBox<dyn Builtin>>)

User-provided function.

Implementations§

Amount of non-default required arguments

Function name, as defined in code.

Call function using arguments evaluated in specified call_ctx Context.

If tailstrict is specified - then arguments will be evaluated before being passed to function body.

Convert jsonnet function to plain Fn value.

Is this function an indentity function.

Currently only works for builtin std.id, aka Self::Id value, and function(x) x.

This function should only be used for optimization, not for the conditional logic, i.e code should work with syntetic identity function too

Identity function value.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Define how to visit values referred by this value. Read more
Whether this type should be tracked by the collector. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.