Mojo struct
Attr
A generic object's attributes are set on construction, after which the attributes can be read and modified, but no attributes may be removed or added.
Fieldsβ
- βkey (
StringLiteral
): The name of the attribute. - βvalue (
object
): The value of the attribute.
Implemented traitsβ
AnyType
Methodsβ
__init__
β
__init__(inout self: Self, key: StringLiteral, owned value: object)
Initializes the attribute with a key and value.
Args:
- βkey (
StringLiteral
): The string literal key. - βvalue (
object
): The object value of the attribute.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
If you'd like to share more information, please report an issue on GitHub
π What went wrong?