For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
traits
Core object-lifetime and value-semantics traits.
The traits package defines the stabilized traits that describe how Mojo
values are created, copied, moved, and destroyed: AnyType, Deinitable,
Movable, Copyable, and ImplicitlyCopyable. These traits are Mojo
built-ins and are automatically imported into every Mojo program through the
prelude.
Modules
-
anytype: DefinesAnyType, the most basic trait that all Mojo types extend by default. -
copyable: DefinesCopyableandImplicitlyCopyable, the traits for types whose value can be copied. -
deinitable: DefinesDeinitable, the trait for types with lifetime management through destructors. -
movable: DefinesMovable, the trait for types whose value can be moved.