IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
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).

Origin

struct Origin[mut: Bool, _mlir_origin: LITOrigin[mut], //]

This represents a origin reference for a memory value.

Parameters

  • mut (Bool): Whether the origin is mutable.
  • _mlir_origin (LITOrigin[mut]): The raw MLIR origin value.

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, RegisterPassable, TrivialRegisterPassable

Methods

__init__

__init__() -> Self

Construct an Origin.

@implicit __init__(v: Origin[mut=v.mut]) -> ImmutOrigin

Implicitly convert an origin to an immutable one.

Args:

Returns:

ImmutOrigin

unsafe_mut_cast

static unsafe_mut_cast[dest_mut: Bool]() -> Origin[mut=dest_mut]

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

Parameters:

  • dest_mut (Bool): The desired mutability of the resulting origin.

Returns:

Origin[mut=dest_mut]: The same origin but with a new specified mutability.