
Public Member Functions | |
| 'Metadata' | __add__ (self, Any other) |
| bool | __contains__ (self, MetadataKey key) |
| None | __delitem__ (self, MetadataKey key) |
| bool | __eq__ (self, Any other) |
| MetadataValue | __getitem__ (self, MetadataKey key) |
| None | __init__ (self, *Tuple[MetadataKey, MetadataValue] args) |
| Iterator[Tuple[MetadataKey, MetadataValue]] | __iter__ (self) |
| int | __len__ (self) |
| str | __repr__ (self) |
| None | __setitem__ (self, MetadataKey key, MetadataValue value) |
| None | add (self, MetadataKey key, MetadataValue value) |
| None | delete_all (self, MetadataKey key) |
| def | from_tuple (cls, tuple raw_metadata) |
| List[MetadataValue] | get_all (self, MetadataKey key) |
| None | set_all (self, MetadataKey key, List[MetadataValue] values) |
Private Attributes | |
| _metadata | |
Metadata abstraction for the asynchronous calls and interceptors.
The metadata is a mapping from str -> List[str]
Traits
* Multiple entries are allowed for the same key
* The order of the values by key is preserved
* Getting by an element by key, retrieves the first mapped value
* Supports an immutable view of the data
* Allows partial mutation on the data without recreating the new object from scratch.
Definition at line 23 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.__init__ | ( | self, | |
| *Tuple[MetadataKey, MetadataValue] | args | ||
| ) |
Definition at line 36 of file src/python/grpcio/grpc/aio/_metadata.py.
Definition at line 111 of file src/python/grpcio/grpc/aio/_metadata.py.
| bool grpc.aio._metadata.Metadata.__contains__ | ( | self, | |
| MetadataKey | key | ||
| ) |
Definition at line 101 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.__delitem__ | ( | self, | |
| MetadataKey | key | ||
| ) |
``del metadata[<key>]`` deletes the first mapping for <key>.
Definition at line 76 of file src/python/grpcio/grpc/aio/_metadata.py.
Definition at line 104 of file src/python/grpcio/grpc/aio/_metadata.py.
| MetadataValue grpc.aio._metadata.Metadata.__getitem__ | ( | self, | |
| MetadataKey | key | ||
| ) |
When calling <metadata>[<key>], the first element of all those mapped for <key> is returned.
Definition at line 57 of file src/python/grpcio/grpc/aio/_metadata.py.
| Iterator[Tuple[MetadataKey, MetadataValue]] grpc.aio._metadata.Metadata.__iter__ | ( | self | ) |
Definition at line 87 of file src/python/grpcio/grpc/aio/_metadata.py.
| int grpc.aio._metadata.Metadata.__len__ | ( | self | ) |
Return the total number of elements that there are in the metadata, including multiple values for the same key.
Definition at line 51 of file src/python/grpcio/grpc/aio/_metadata.py.
| str grpc.aio._metadata.Metadata.__repr__ | ( | self | ) |
Definition at line 118 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.__setitem__ | ( | self, | |
| MetadataKey | key, | ||
| MetadataValue | value | ||
| ) |
Calling metadata[<key>] = <value> Maps <value> to the first instance of <key>.
Definition at line 66 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.add | ( | self, | |
| MetadataKey | key, | ||
| MetadataValue | value | ||
| ) |
Definition at line 47 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.delete_all | ( | self, | |
| MetadataKey | key | ||
| ) |
Delete all mappings for <key>.
Definition at line 83 of file src/python/grpcio/grpc/aio/_metadata.py.
| def grpc.aio._metadata.Metadata.from_tuple | ( | cls, | |
| tuple | raw_metadata | ||
| ) |
Definition at line 42 of file src/python/grpcio/grpc/aio/_metadata.py.
| List[MetadataValue] grpc.aio._metadata.Metadata.get_all | ( | self, | |
| MetadataKey | key | ||
| ) |
For compatibility with other Metadata abstraction objects (like in Java), this would return all items under the desired <key>.
Definition at line 92 of file src/python/grpcio/grpc/aio/_metadata.py.
| None grpc.aio._metadata.Metadata.set_all | ( | self, | |
| MetadataKey | key, | ||
| List[MetadataValue] | values | ||
| ) |
Definition at line 98 of file src/python/grpcio/grpc/aio/_metadata.py.
|
private |
Definition at line 37 of file src/python/grpcio/grpc/aio/_metadata.py.