[−][src]Struct grpcio::Metadata
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'.
Methods
impl Metadata
[src]
pub fn len(&self) -> usize
[src]
Returns the count of metadata entries.
pub fn is_empty(&self) -> bool
[src]
Returns true if there is no metadata entries.
pub fn get(&self, index: usize) -> Option<(&str, &[u8])>
[src]
Returns the metadata entry at the index
.
None
is returned if out of bound.
ⓘImportant traits for MetadataIter<'a>pub fn iter(&self) -> MetadataIter
[src]
Returns an iterator over the metadata entries.
Trait Implementations
impl Clone for Metadata
[src]
fn clone(&self) -> Metadata
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Drop for Metadata
[src]
impl<'a> IntoIterator for &'a Metadata
[src]
type IntoIter = MetadataIter<'a>
Which kind of iterator are we turning this into?
type Item = (&'a str, &'a [u8])
The type of the elements being iterated over.
ⓘImportant traits for MetadataIter<'a>fn into_iter(self) -> MetadataIter<'a>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,