[][src]Module jlrs::value

Julia values and functions.

When using this crate Julia data will usually be returned as a Value. A Value is a "generic" wrapper. Type information will generally be available allowing you to safely convert a Value to its actual type. Data like arrays and modules can be returned as a Value. These, and other types with a custom implementation in the C API, can be found in the submodules of this module.

One special property of a Value is that it can always be called as a function; there's no way to check if a Value is actually a function except trying to call it. Multiple Values can be created at the same time by using Values.

Modules

array

Support for n-dimensional arrays and their dimensions.

code_instance

Support for values with the Core.CodeInstance type.

datatype

Datatypes and properties.

expr

Support for values with the Core.Expr type.

method

Support for values with the Core.Method type.

method_instance

Support for values with the Core.MethodInstance type.

method_table

Support for values with the Core.MethodTable type.

module

Access Julia modules and the globals and functions defined in them.

simple_vector

Support for values with the Core.SimpleVector (SVec) type.

string

Support for accessing raw Julia strings.

symbol

Symbols represent identifiers like module and function names.

task

Support for values with the Core.Task type.

tuple

Generic Tuples of different sizes.

type_name

Support for values with the Core.TypeName type.

type_var

Support for values with the Core.TypeVar type.

typemap_entry

Support for values with the Core.TypeMapEntry type.

typemap_level

Support for values with the Core.TypeMapLevel type.

union

Support for Julia Unions and union-fields.

union_all

Support for values with the Core.UnionAll type.

weak_ref

Support for values with the Core.WeakRef type.

Structs

Value

When working with the Julia C API most data is returned as a raw pointer to a jl_value_t. This pointer is similar to a void pointer in the sense that this pointer can point to data of any type. It's up to the user to determine the correct type and cast the pointer. In order to make this possible, data pointed to by a jl_value_t-pointer is guaranteed to be preceded in memory by a fixed-size header that contains its type and layout-information.

Values

Several values that are allocated consecutively. This can be used in combination with Value::call_values and WithOutput::call_values.

WithOutput

A wrapper that will let you call a Value as a function and store the result using an Output. The function call will not require a slot in the current frame but uses the one that was allocated for the output. You can create this by calling Value::with_output.

Type Definitions

CallResult

This type alias is used to encode the result of a function call: Ok indicates the call was successful and contains the function's result, while Err indicates an exception was thrown and contains said exception.