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).
value
Defines Defaultable, RegisterPassable, and TrivialRegisterPassable, plus deprecated aliases for the value-semantics traits that used to live in this module.
Movable, Copyable, and ImplicitlyCopyable have moved to std.traits.
They're still exported from the prelude, so most code doesn't need to
change; see the deprecated aliases below for the explicit import paths.
comptime values
Copyable
comptime Copyable = Copyable
Deprecated: The trait for types whose value can be explicitly copied.
This trait has moved to std.traits.copyable. It's exported from the
prelude, so most code doesn't need to change. This alias will be removed in
a future version of Mojo.
Deprecated: Copyable has moved to std.traits. It's still exported from the prelude, so most code needs no changes; for the explicit import path use std.traits.copyable.Copyable.
ImplicitlyCopyable
comptime ImplicitlyCopyable = ImplicitlyCopyable
Deprecated: A marker trait to permit the compiler to insert implicit copies.
This trait has moved to std.traits.copyable. It's exported from the
prelude, so most code doesn't need to change. This alias will be removed in
a future version of Mojo.
Deprecated: ImplicitlyCopyable has moved to std.traits. It's still exported from the prelude, so most code needs no changes; for the explicit import path use std.traits.copyable.ImplicitlyCopyable.
Movable
comptime Movable = Movable
Deprecated: The trait for types whose value can be moved.
This trait has moved to std.traits.movable. It's exported from the
prelude, so most code doesn't need to change. This alias will be removed in
a future version of Mojo.
Deprecated: Movable has moved to std.traits. It's still exported from the prelude, so most code needs no changes; for the explicit import path use std.traits.movable.Movable.
Traits
-
Defaultable: TheDefaultabletrait describes a type with a default constructor. -
RegisterPassable: A marker trait to denote the type to be register passable. -
TrivialRegisterPassable: A marker trait to denote the type to be register passable trivial.
Functions
-
materialize: Explicitly materialize a compile-time parameter into a run-time value.