Skip to main content
Log in

Mojo trait

BoolableCollectionElement

The BoolableCollectionElement trait denotes a trait composition of the Boolable and CollectionElement traits.

This is useful to have as a named entity since Mojo does not currently support anonymous trait compositions to constrain on Boolable & CollectionElement in the parameter.

Implemented traits

AnyType, Boolable, CollectionElement, Copyable, Movable, UnknownDestructibility

Methods

__copyinit__

__copyinit__(out self: _Self, existing: _Self, /)

Create a new instance of the value by copying an existing one.

Args:

  • existing (_Self): The value to copy.

__moveinit__

__moveinit__(out self: _Self, owned existing: _Self, /)

Create a new instance of the value by moving the value of another.

Args:

  • existing (_Self): The value to move.

__bool__

__bool__(self: _Self) -> Bool

Get the boolean representation of the value.

Returns:

The boolean representation of the value.