Expand description
Generic Tuple
s of different sizes.
In this module generic tuple types from Tuple0
up to and including Tuple32
are available.
These types can be used to work with tuple values from Julia. A new tuple can be created with
Value::new
if all fields implement the IntoJulia
trait:
julia.scope(|global, mut frame| {
let tup = Tuple2(2i32, true);
let val = Value::new(&mut frame, tup)?;
assert!(val.is::<Tuple2<i32, bool>>());
assert!(val.unbox::<Tuple2<i32, bool>>().is_ok());
Ok(())
}).unwrap();
Additionally, Tuple
can be used to create a tuple from an arbitrary number of Value
s.
Structs
A tuple that has an arbitrary number of fields. This type can be used as a typecheck to check if the data is a tuple type, and to create tuples of arbitrary sizes.