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
Vec<u8>bytesDifferent from sequence<u8> only in foreign type mappings
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<K, V>record<K, T>
()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.