Public Member Functions | Private Attributes | List of all members
grpc.aio._metadata.Metadata Class Reference
Inheritance diagram for grpc.aio._metadata.Metadata:
Inheritance graph
[legend]

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[MetadataValueget_all (self, MetadataKey key)
 
None set_all (self, MetadataKey key, List[MetadataValue] values)
 

Private Attributes

 _metadata
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

None grpc.aio._metadata.Metadata.__init__ (   self,
*Tuple[MetadataKey, MetadataValue args 
)

Definition at line 36 of file src/python/grpcio/grpc/aio/_metadata.py.

Member Function Documentation

◆ __add__()

'Metadata' grpc.aio._metadata.Metadata.__add__ (   self,
Any  other 
)

Definition at line 111 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ __contains__()

bool grpc.aio._metadata.Metadata.__contains__ (   self,
MetadataKey  key 
)

Definition at line 101 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ __delitem__()

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.

◆ __eq__()

bool grpc.aio._metadata.Metadata.__eq__ (   self,
Any  other 
)

Definition at line 104 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ __getitem__()

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.

◆ __iter__()

Iterator[Tuple[MetadataKey, MetadataValue]] grpc.aio._metadata.Metadata.__iter__ (   self)

Definition at line 87 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ __len__()

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.

◆ __repr__()

str grpc.aio._metadata.Metadata.__repr__ (   self)

Definition at line 118 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ __setitem__()

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.

◆ add()

None grpc.aio._metadata.Metadata.add (   self,
MetadataKey  key,
MetadataValue  value 
)

Definition at line 47 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ delete_all()

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.

◆ from_tuple()

def grpc.aio._metadata.Metadata.from_tuple (   cls,
tuple  raw_metadata 
)

Definition at line 42 of file src/python/grpcio/grpc/aio/_metadata.py.

◆ get_all()

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.

◆ set_all()

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.

Member Data Documentation

◆ _metadata

grpc.aio._metadata.Metadata._metadata
private

Definition at line 37 of file src/python/grpcio/grpc/aio/_metadata.py.


The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:32