Skip to main content
Log in

Mojo struct

Attr

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, UnknownDestructibility

Methods

__init__

__init__(out 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.