logo
pub struct Value { /* private fields */ }
Expand description

sciter::value wrapper.

See the module-level documentation.

Implementations

Return a new Sciter value object (undefined).

Make an explicit array value with the given length.

Make an explicit map value.

Make an explicit json null value.

Make an explicit nothing (where did it come from?).

Make Sciter symbol value.

Make Sciter error value.

Make Sciter color value, in 0xAABBGGRR form.

Make Sciter duration value, in seconds.

Make Sciter angle value, in radians.

Parse a json string into value. Returns the number of chars left unparsed in case of error.

Parse a json string into value. Returns the number of chars left unparsed in case of error.

Value to asset.

Returns a raw pointer to the underlaying data.

Get the inner type of the value.

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

Convert T_OBJECT value type to JSON T_MAP or T_ARRAY types.

Also must be used if you need to pass values between different threads.

Clear the value. It 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 value types.

Append another value to the end of T_ARRAY value.

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

Retreive value of sub-element at index.

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

Insert or set value of the sub-element by key.

  • T_MAP - sets named value in the map;
  • T_OBJECT - sets value of property of the object;
  • T_FUNCTION - sets named argument of the function;
  • otherwise it converts self to the map type and adds the key/value to it.

Retrieve the value of a sub-element by key.

Retrieve the key of a sub-element by index.

An iterator visiting all keys of key/value pairs in the map.

  • T_MAP - keys of key/value pairs in the map;
  • T_OBJECT - names of key/value properties in the object;
  • T_FUNCTION - names of arguments of the function (if any).

The iterator element type is Value (as a key).

An iterator visiting all values in arbitrary order.

  • T_ARRAY - elements of the array;
  • T_MAP - values of key/value pairs in the map;
  • T_OBJECT - values of key/value properties in the object;
  • T_FUNCTION - values of arguments of the function.

The iterator element type is Value.

An iterator visiting all key-value pairs in arbitrary order.

The Value must has a key-value type (map, object, function).

The iterator element type is (Value, Value).

Value to integer.

Value to bool.

Value to float.

Value to color.

Value to duration.

Value to angle.

Value as string for T_STRING type.

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

Value as a byte slice for T_BYTES type.

Value to byte vector for T_BYTES type.

Function invocation for T_OBJECT with UT_OBJECT_FUNCTION value type.

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).

The name here is an url or a name of the script - used for error reporting in script.

You can use the make_args!(args...) macro which helps you to construct script arguments from Rust types.

Returns true is self is undefined or has zero elements.

I.e. non-reference types that do not need a destructor.

Trait Implementations

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

Print Value as json string with explicit type showed.

Formats the value using the given formatter. Read more

Return default value (undefined).

Returns the “default value” for a type. Read more

Print Value as json string

Formats the value using the given formatter. Read more

Destroy pointed value.

Executes the destructor for this type. Read more

Value from bool.

Performs the conversion.

Value from float.

Performs the conversion.

Value from integer.

Performs the conversion.

Value from binary array (sequence of bytes).

Performs the conversion.

Performs the conversion.

Value from a native VALUE object.

Performs the conversion.

Value from string.

Performs the conversion.

Value from nothing (()) for empty return values.

Returns undefined value.

Performs the conversion.

Value from asset.

Performs the conversion.

Value from function.

Performs the conversion.

Store the Graphics object as a Value.

Performs the conversion.

Store the Image object as a Value.

Performs the conversion.

Store the Path object as a Value.

Performs the conversion.

Value from Result.

Performs the conversion.

Value from string.

Performs the conversion.

Value from time/date.

See the [VALUE_TIME::T_DATE].

Store the Text object as a Value.

Performs the conversion.

Value from bool.

Performs the conversion.

Value from float.

Performs the conversion.

Value from integer.

Performs the conversion.

Value from sequence of &str.

Creates a value from an iterator. Read more

Value from sequence of String.

Creates a value from an iterator. Read more

Value from sequence of Value.

Creates a value from an iterator. Read more

Value from sequence of f64.

Creates a value from an iterator. Read more

Value from sequence of i32.

Creates a value from an iterator. Read more

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

Converts value to specified type.

Get item by string key for map type.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Get item by key for map type.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Get item by index for array type.

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Conversion into an Iterator.

Adds the for loop syntax support: for subitem in &value {].

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Compare two values.

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

This method tests for !=.

Store the DOM element as a Value.

Since 4.4.3.26, perhaps.

The type returned in the event of a conversion error.

Performs the conversion.

sciter::Value can be transferred across thread boundaries.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. 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.