Skip to main content

Mojo module

type_aliases

Defines some type aliases.

These are Mojo built-ins, so you don't need to import them.

comptime values

__TypeOfAllTypes

comptime __TypeOfAllTypes = __TypeOfAllTypes

Represents any register passable Mojo data type.

AnyOrigin

comptime AnyOrigin[*, mut: Bool] = AnyOrigin[mut._mlir_value]

An origin that might access any memory value.

Parameters

  • mut (Bool): Whether the origin is mutable.

EllipsisType

comptime EllipsisType = __mlir_type.!lit.ellipsis``

The type of the ... literal.

ExternalOrigin

comptime ExternalOrigin[*, mut: Bool] = ExternalOrigin[mut._mlir_value]

A parameterized external origin guaranteed not to alias any existing origins.

An external origin implies there is no previously existing value that this origin aliases. The compiler cannot track the origin or the value's lifecycle. Useful when interfacing with memory from outside the current Mojo program.

Parameters

  • mut (Bool): Whether the origin is mutable.

ImmutAnyOrigin

comptime ImmutAnyOrigin = ImmutAnyOrigin

The immutable origin that might access any memory value.

ImmutExternalOrigin

comptime ImmutExternalOrigin = ImmutExternalOrigin

An immutable external origin guaranteed not to alias any existing origins.

An external origin implies there is no previously existing value that this origin aliases. The compiler cannot track the origin or the value's lifecycle. Useful when interfacing with memory from outside the current Mojo program.

ImmutOrigin

comptime ImmutOrigin = ImmutOrigin

Immutable origin reference type.

MutAnyOrigin

comptime MutAnyOrigin = MutAnyOrigin

The mutable origin that might access any memory value.

MutExternalOrigin

comptime MutExternalOrigin = MutExternalOrigin

A mutable external origin guaranteed not to alias any existing origins.

An external origin implies there is no previously existing value that this origin aliases. The compiler cannot track the origin or the value's lifecycle. Useful when interfacing with memory from outside the current Mojo program.

MutOrigin

comptime MutOrigin = MutOrigin

Mutable origin reference type.

Never

comptime Never = Never

A type that can never have an instance constructed, used as a function result by functions that never return.

OriginSet

comptime OriginSet = LITOriginSet

A set of origin parameters.

StaticConstantOrigin

comptime StaticConstantOrigin = StaticConstantOrigin

An origin for strings and other always-immutable static constants.

unsafe_origin_mutcast

comptime unsafe_origin_mutcast[mut: Bool, //, o: Origin[mut=mut], mut: Bool = True] = o

Cast an origin to a different mutability, potentially introducing more mutability, which is an unsafe operation.

Returns: A new origin with the specified mutability.

Parameters

  • mut (Bool): The mutability of the resulting origin.
  • o (Origin): The origin to cast.
  • mut (Bool):

Structs

  • Origin: This represents a origin reference for a memory value.

Was this page helpful?