Module jlrs::value[][src]

Julia values and functions.

Julia data returned by the C API is normally returned as a pointer to a jl_value_t, in jlrs this pointer is wrapped by a Value. Much functionality offered by the C API is available through the methods and traits implemented for Value, including creating new Julia values, accessing their type information and fields, checking if certain properties hold, and converting the value to another type.

One special kind of value is the NamedTuple. You will need to create values of this type in order to call functions with keyword arguments. The macro named_tuple is defined in this module which provides an easy way to create values of this type.

Julia has several builtin types, like Array, Module, and Symbol. These builtin types are defined in the submodules of this module.

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.

traits

Traits to call functions and derivable traits.

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

LeakedValue

While jlrs generally enforces that Julia data can only exist and be used while a frame is active, it’s possible to leak global values: Symbols, Modules, and globals defined in those modules.

UnrootedValue

A Value that has not yet been rooted.

Value

A Value is a wrapper around a pointer to some data owned by the Julia garbage collector, it has two lifetimes: 'frame and 'data. The first of these ensures that a Value can only be used while it’s rooted in a GcFrame, the second accounts for data borrowed from Rust. The only way to borrow data from Rust is to create an Julia array that borrows its contents by calling Value::borrow_array, if a Julia function is called with such an array as an argument the result will inherit the second lifetime of the borrowed data to ensure that such a Value can onl be used while the borrow is active.

WithKeywords

A function with keyword arguments. It can be called with the methods of the Call trait.

Enums

UnrootedResult

A JuliaResult that has not yet been rooted.

Constants

MAX_SIZE

In some cases it’s necessary to place one or more arguments in front of the arguments a function is called with. Examples include the named_tuple macro and Value::call_async. If they are called with fewer than MAX_SIZE arguments (including the added arguments), no heap allocation is required to store them.