struct
OwnedKwargsDict
Container used to pass owned variadic keyword arguments to functions.
This type mimics the interface of a dictionary with String
keys, and
should be usable more-or-less like a dictionary. Notably, however, this type
should not be instantiated directly by users.
Parameters
- V (
CollectionElement
): The value type of the dictionary. Currently must be CollectionElement.
Aliases
key_type = String
:
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
Movable
,
Sized
Methods
__init__
__init__(inout self: Self)
Initialize an empty keyword dictionary.
__copyinit__
__copyinit__(inout self: Self, existing: Self)
Copy an existing keyword dictionary.
Args:
- existing (
Self
): The existing keyword dictionary.
__moveinit__
__moveinit__(inout self: Self, owned existing: Self)
Move data of an existing keyword dictionary into a new one.
Args:
- existing (
Self
): The existing keyword dictionary.
__getitem__
__getitem__(self: Self, key: String) -> V
Retrieve a value out of the keyword dictionary.
Args:
- key (
String
): The key to retrieve.
Returns:
The value associated with the key, if it's present.
Raises:
"KeyError" if the key isn't present.
__setitem__
__setitem__(inout self: Self, key: String, value: V)
Set a value in the keyword dictionary by key.
Args: