Struct jsonnet::JsonValue [] [src]

pub struct JsonValue<'a> { /* fields omitted */ }

Rust wrapper for owned libjsonnet JSON values.

These are used as return values from jsonnet native callbacks. See JsonVal for the borrowed version.

Methods

impl<'a> JsonValue<'a>
[src]

[src]

Construct a JsonValue from a pointer returned from a low-level jsonnet C function.

Safety

It is up to the caller to ensure that p was indeed allocated by vm.

[src]

Returns the inner pointer to this jsonnet value.

The returned pointer will be valid for as long as self is.

[src]

Returns the value, if it is a string.

[src]

Returns the value, if it is a number.

[src]

Returns the value, if it is a bool.

[src]

Returns Some(()) if the value is null.

[src]

Convert the given UTF8 string to a JsonValue.

Panics

Panics if v contains an embedded nul character.

[src]

Convert the given double to a JsonValue.

[src]

Convert the given bool to a JsonValue.

[src]

Make a JsonValue representing null.

[src]

Convert the given list into a JsonValue array.

[src]

Convert the given map into a JsonValue object.

[src]

Transfer ownership to a C caller (presumably a jsonnet function).

If you call this, it is up to you to ensure that the value is freed correctly (using the appropriate jsonnet function), or the memory will leak.

Trait Implementations

impl<'a> Drop for JsonValue<'a>
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a> !Send for JsonValue<'a>

impl<'a> !Sync for JsonValue<'a>