#[repr(transparent)]
pub struct Metadata(_);
Expand description

A collection of metadata entries that can be exchanged during a call.

gRPC supports these types of metadata:

  • Request headers

    They are sent by the client at the beginning of a remote call before any request messages are sent.

  • Response headers

    They are sent by the server at the beginning of a remote call handler before any response messages are sent.

  • Response trailers

    They are sent by the server at the end of a remote call along with resulting call status.

Metadata value can be ascii string or bytes. They are distinguish by the key suffix, key of bytes value should have suffix ‘-bin’.

Implementations

Returns the count of metadata entries.

Returns true if there is no metadata entries.

Returns the metadata entry at the index.

None is returned if out of bound.

Returns an iterator over the metadata entries.

Decomposes a Metadata array into its raw components.

Returns the raw pointer to the underlying data, the length of the vector (in elements), and the allocated capacity of the data (in elements). These are the same arguments in the same order as the arguments to from_raw_parts.

After calling this function, the caller is responsible for the memory previously managed by the Metadata. The only way to do this is to convert the raw pointer, length, and capacity back into a Metadata with the from_raw_parts function, allowing the destructor to perform the cleanup.

Creates a Metadata directly from the raw components of another vector.

Safety

The operation is safe only if the three arguments are returned from into_raw_parts and only convert once.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.