pub enum Val {
    Bool(bool),
    Null,
    Str(StrValue),
    Num(f64),
    Arr(ArrValue),
    Obj(ObjValue),
    Func(FuncVal),
}
Expand description

Represents any valid Jsonnet value.

Variants§

§

Bool(bool)

Represents a Jsonnet boolean.

§

Null

Represents a Jsonnet null value.

§

Str(StrValue)

Represents a Jsonnet string.

§

Num(f64)

Represents a Jsonnet number. Should be finite, and not NaN This restriction isn’t enforced by enum, as enum field can’t be marked as private

§

Arr(ArrValue)

Represents a Jsonnet array.

§

Obj(ObjValue)

Represents a Jsonnet object.

§

Func(FuncVal)

Represents a Jsonnet function.

Implementations§

Creates Val::Num after checking for numeric overflow. As numbers are f64, we can just check for their finity.

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
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Creates a value from an iterator. Read more
Serialize this value into the given Serde serializer. 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.