Skip to main content

Mojo struct

Origin

@register_passable(trivial) struct Origin[*, mut: Bool]

This represents a origin reference for a memory value.

Parameters

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

Implemented traits

AnyType, Copyable, ImplicitlyCopyable, ImplicitlyDestructible, Movable, TrivialRegisterType

comptime members

__copyinit__is_trivial

comptime __copyinit__is_trivial = True

__del__is_trivial

comptime __del__is_trivial = True

__moveinit__is_trivial

comptime __moveinit__is_trivial = True

Methods

__init__

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

Allow converting an mutable origin to an immutable one.

Args:

  • other (Origin): The mutable origin to convert.

Returns:

ImmutOrigin

Was this page helpful?