Skip to main content

Mojo struct

NoneType

@register_passable(trivial) struct NoneType

Represents the absence of a value.

Implemented traits

AnyType, Copyable, Defaultable, ExplicitlyCopyable, Movable, Representable, Stringable, UnknownDestructibility, Writable

Aliases

__copyinit__is_trivial

alias __copyinit__is_trivial = True

__del__is_trivial

alias __del__is_trivial = True

__moveinit__is_trivial

alias __moveinit__is_trivial = True

Methods

__init__

__init__() -> Self

Construct an instance of the None type.

@implicit __init__(value: None) -> Self

Construct an instance of the None type.

Args:

  • value (None): The MLIR none type to construct from.

__str__

__str__(self) -> String

Returns the string representation of None.

Returns:

String: "None".

__repr__

__repr__(self) -> String

Returns the string representation of None.

Returns:

String: "None".

write_to

write_to(self, mut writer: T)

Write None to a writer stream.

Args:

  • writer (T): The object to write to.

Was this page helpful?