Mojo trait
StringableCollectionElement
The StringableCollectionElement trait denotes a trait composition of the CollectionElement
and Stringable
traits.
This is useful to have as a named entity since Mojo does not
currently support anonymous trait compositions to constrain
on CollectionElement & Stringable
in the parameter.
Implemented traitsβ
AnyType
,
CollectionElement
,
Copyable
,
Movable
,
Stringable
Methodsβ
__copyinit__
β
__copyinit__(inout self: T, existing: T, /)
Create a new instance of the value by copying an existing one.
Args:
- βexisting (
T
): The value to copy.
__moveinit__
β
__moveinit__(inout self: T, owned existing: T, /)
Create a new instance of the value by moving the value of another.
Args:
- βexisting (
T
): The value to move.
__str__
β
__str__(self: T) -> String
Get the string representation of the type.
Returns:
The string representation of the type.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?