Built-in types

The following built-in types can be passed as arguments/returned by Rust methods:

Rust typeUDL typeNotes
boolboolean
u8/i8..u64/i64u8/i8..u64/i64
f32float
f64double
Stringstring
SystemTimetimestampPrecision may be lost when converting to Python and Swift types
Duration durationPrecision may be lost when converting to Python and Swift types
&T[ByRef] TThis works for &str and &[T]
Option<T>T?
Vec<T>sequence<T>
HashMap<String, T>record<DOMString, T>Only string keys are supported
()voidEmpty return
Result<T, E>N/ASee Errors section

And of course you can use your own types, which is covered in the following sections.