Struct grpcio::MetadataBuilder[][src]

pub struct MetadataBuilder { /* fields omitted */ }

Builder for immutable Metadata.

Implementations

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

impl RefUnwindSafe for MetadataBuilder

impl Send for MetadataBuilder

impl !Sync for MetadataBuilder

impl Unpin for MetadataBuilder

impl UnwindSafe for MetadataBuilder

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.