Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Type Mappings

Complete reference for Rust → target language type mappings.

Primitive Types

Rust TypeTypeScriptPythonGoSwiftKotlinGraphQLJSON Schema
StringstringstrstringStringStringStringstring
boolbooleanboolboolBoolBooleanBooleanboolean
u8numberintuint8UInt8UByteIntinteger
u16numberintuint16UInt16UShortIntinteger
u32numberintuint32UInt32UIntIntinteger
u64bigintintuint64UInt64ULongStringinteger
i8numberintint8Int8ByteIntinteger
i16numberintint16Int16ShortIntinteger
i32numberintint32Int32IntIntinteger
i64bigintintint64Int64LongStringinteger
f32numberfloatfloat32FloatFloatFloatnumber
f64numberfloatfloat64DoubleDoubleFloatnumber

Special Types

Rust TypeTypeScriptPythonGoSwiftKotlinGraphQLJSON Schema
UuidstringUUIDstringUUIDStringIDstring (uuid)
DateTime<Utc>stringdatetimetime.TimeDateInstantDateTimestring (date-time)
NaiveDatestringdateN/AN/AN/AN/Astring (date)
serde_json::ValueunknownAnyinterface{}AnyJsonElementJSON{}

Container Types

Rust TypeTypeScriptPythonGoSwiftKotlinGraphQLJSON Schema
Option<T>T | undefinedOptional[T] = None*T (omitempty)T?T? = nullNullableNot in required
Vec<T>T[]list[T][]T[T]List<T>[T!]array
HashMap<K,V>Record<K, V>dict[K, V]map[K]V[K: V]Map<K, V>JSONobject
(A, B, ...)N/ATuple[A, B, ...]N/AN/AN/AN/AprefixItems

Custom Types

Custom structs and enums are referenced by name in all languages.