Struct grpcio::MetadataBuilder [−][src]
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]
&mut self,
key: &str,
value: &str
) -> Result<&mut MetadataBuilder>
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]
&mut self,
key: &str,
value: &[u8]
) -> Result<&mut MetadataBuilder>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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>,