class documentation
class Map(MutableMapping[
Constructor: Map(source, wrap, unwrap, mask_function)
Wrapper for protobuf map fields with optional wrapping.
| Parameters | |
| source | Underlying protobuf mapping. |
| wrap | Optional wrapper for inner values. |
| unwrap | Optional unwrapping function for outer values. |
| mask | Optional mask builder for values. |
| Class Method | with |
Create a factory that wraps protobuf map fields. |
| Method | __delitem__ |
Delete a map entry. |
| Method | __getitem__ |
Return a wrapped map value. |
| Method | __init__ |
Wrap a protobuf map field. |
| Method | __iter__ |
Return an iterator over map keys. |
| Method | __len__ |
Return the number of entries. |
| Method | __repr__ |
Return a multi-line representation of the map. |
| Method | __setitem__ |
Set a map entry. |
| Method | get |
Compute the reset mask for a full update of this map. |
| Instance Variable | _mask |
Undocumented |
| Instance Variable | _source |
Undocumented |
| Instance Variable | _unwrap |
Undocumented |
| Instance Variable | _wrap |
Undocumented |
@classmethod
def with_wrap(cls, wrap:
def with_wrap(cls, wrap:
Callable[ [ CollectibleInner], CollectibleOuter] | None = None, unwrap: Callable[ [ CollectibleOuter], CollectibleInner] | None = None, mask_function: MaskFunction | None = None) -> Callable[ [ MutableMapping[ MapKey, CollectibleInner]], Map[ MapKey, CollectibleOuter]]:
(source)
¶
Create a factory that wraps protobuf map fields.
| Parameters | |
wrap:Callable[ | Optional wrapper for inner values. |
unwrap:Callable[ | Optional unwrapping function for outer values. |
maskMaskFunction | None | Optional mask builder for values. |
| Returns | |
Callable[ | Callable that wraps a map field. |
def __init__(self, source:
MutableMapping[ MapKey, CollectibleInner], wrap: Callable[ [ CollectibleInner], CollectibleOuter] | None = None, unwrap: Callable[ [ CollectibleOuter], CollectibleInner] | None = None, mask_function: MaskFunction | None = None):
(source)
¶
Wrap a protobuf map field.