[][src]Struct grpcio::MetadataBuilder

pub struct MetadataBuilder { /* fields omitted */ }

Builder for immutable Metadata.

Methods

impl MetadataBuilder[src]

pub fn new() -> MetadataBuilder[src]

Create a builder with empty initial capacity.

pub fn with_capacity(cap: usize) -> MetadataBuilder[src]

Create a builder with the given value.

pub fn add_str(
    &mut self,
    key: &str,
    value: &str
) -> Result<&mut MetadataBuilder>
[src]

Add a metadata holding an ASCII value.

key must not use suffix (-bin) indicating a binary valued metadata entry.

pub fn add_bytes(
    &mut self,
    key: &str,
    value: &[u8]
) -> Result<&mut MetadataBuilder>
[src]

Add a metadata holding a binary value.

key needs to have suffix (-bin) indicating a binary valued metadata entry.

pub fn build(self) -> Metadata[src]

Create Metadata with configured entries.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.