Skip to main content

Mojo trait

StringableIdentifiable

The StringableIdentifiable trait denotes a trait composition of the Stringable and Identifiable traits.

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

Implemented traits

AnyType, Identifiable, Stringable

Methods

__is__

__is__(self: _Self, rhs: _Self) -> Bool

Define whether self has the same identity as rhs.

Args:

  • rhs (_Self): The right hand side of the comparison.

Returns:

True if self is rhs.

__isnot__

__isnot__(self: _Self, rhs: _Self) -> Bool

Define whether self has a different identity than rhs.

Args:

  • rhs (_Self): The right hand side of the comparison.

Returns:

True if self is not rhs.

__str__

__str__(self: _Self) -> String

Get the string representation of the type.

Returns:

The string representation of the type.