Struct sciter::value::Value [] [src]

pub struct Value { /* fields omitted */ }

sciter::value wrapper. See the module-level documentation.

Methods

impl Value
[src]

Return a new sciter value object (undefined).

Make explicit array value with given length.

Make explicit map value.

Make explicit json null value.

Make sciter symbol value.

Make sciter error value.

Parse json string into value.

Parse json string into value.

Parse json string into value. Note that Value::from_str() parses a json string to value object and returns a Result<Value> unlike Value::from(), which returns just string object only.

Get inner value type.

Get inner value type and its subtype (e.g. units).

Convert T_OBJECT value type to JSON T_MAP or T_ARRAY.

Clear the VALUE and deallocates all assosiated structures that are not used anywhere else.

Return the number of items in the T_ARRAY, T_MAP, T_FUNCTION and T_OBJECT sciter::value.

Append value to the end of T_ARRAY sciter::value.

Insert or set value at given index of T_ARRAY, T_MAP, T_FUNCTION and T_OBJECT sciter::value.

Retreive value of sub-element at index

  • T_ARRAY - nth element of the array;
  • T_MAP - value of nth key/value pair in the map;
  • T_FUNCTION - value of nth argument of the function.

Insert or set value of sub-element by key.

  • if it is a map - sets named value in the map;
  • if it is a function - sets named argument of the function;
  • if it is a object - sets value of property of the object;
  • otherwise it converts this to map and adds key/v to it.

Retrieve value of sub-element by key.

Value to integer.

Value to bool.

Value to float.

Value as string for T_STRING type.

Value to json string (converted in-place). Subject to change.

Value as byte slice for T_BYTES type.

Value to byte vector for T_BYTES type.

Function invocation for T_OBJECT/UT_OBJECT_FUNCTION.

Calls the tiscript function or method holded at Value with context of this object that will be known as this inside that function (it is optional for global functions). name here is an url or name of the script - used for error reporting in the script. You can use the make_args!(a,b,c) macro which help you construct script arguments from Rust types.

Trait Implementations

impl Display for Value
[src]

Print Value as json string

Formats the value using the given formatter.

impl Debug for Value
[src]

Print Value as json string with explicit type showed.

Formats the value using the given formatter.

impl Drop for Value
[src]

Destroy pointed value.

A method called when the value goes out of scope. Read more

impl Default for Value
[src]

Return default value (undefined).

Returns the "default value" for a type. Read more

impl Clone for Value
[src]

Copies value.

All allocated objects are reference counted so copying is just a matter of increasing reference counts.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Value
[src]

Compare two values.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Index<usize> for Value
[src]

Get item by index for array type.

The returned type after indexing

The method for the indexing (container[index]) operation

impl Index<Value> for Value
[src]

Get item by key for map type.

The returned type after indexing

The method for the indexing (container[index]) operation

impl Index<&'static str> for Value
[src]

Get item by string key for map type.

The returned type after indexing

The method for the indexing (container[index]) operation

impl From<i32> for Value
[src]

Value from integer.

Performs the conversion.

impl From<f64> for Value
[src]

Value from float.

Performs the conversion.

impl From<bool> for Value
[src]

Value from bool.

Performs the conversion.

impl<'a> From<&'a str> for Value
[src]

Value from string.

Performs the conversion.

impl From<String> for Value
[src]

Value from string.

Performs the conversion.

impl FromStr for Value
[src]

Value from json string.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl<'a> From<&'a [u8]> for Value
[src]

Value from binary array (sequence of bytes).

Performs the conversion.

impl FromIterator<i32> for Value
[src]

Value from sequence of i32.

Creates a value from an iterator. Read more

impl FromIterator<f64> for Value
[src]

Value from sequence of f64.

Creates a value from an iterator. Read more

impl<'a> FromIterator<&'a str> for Value
[src]

Value from sequence of &str.

Creates a value from an iterator. Read more

impl FromIterator<String> for Value
[src]

Value from sequence of String.

Creates a value from an iterator. Read more

impl<F> From<F> for Value where F: Fn(&[Value]) -> Value
[src]

Value from function.

Performs the conversion.