#[non_exhaustive]pub enum CodecFormat {
Proto,
Json,
}Expand description
Supported codec formats.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl CodecFormat
impl CodecFormat
Sourcepub fn from_content_type(content_type: &str) -> Option<Self>
pub fn from_content_type(content_type: &str) -> Option<Self>
Parse codec format from content type string.
Sourcepub fn from_codec(codec: &str) -> Option<Self>
pub fn from_codec(codec: &str) -> Option<Self>
Parse codec format from encoding name (used in GET request query params).
Accepts “proto” or “json” (the values used in the encoding query parameter).
Sourcepub fn content_type(&self) -> &'static str
pub fn content_type(&self) -> &'static str
Get the content type string for this format (unary RPC).
Sourcepub fn streaming_content_type(&self) -> &'static str
pub fn streaming_content_type(&self) -> &'static str
Get the streaming content type string for this format.
Sourcepub fn is_streaming_content_type(content_type: &str) -> bool
pub fn is_streaming_content_type(content_type: &str) -> bool
Check if the given content type indicates a streaming request.
Trait Implementations§
Source§impl Clone for CodecFormat
impl Clone for CodecFormat
Source§fn clone(&self) -> CodecFormat
fn clone(&self) -> CodecFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodecFormat
impl Debug for CodecFormat
Source§impl Display for CodecFormat
impl Display for CodecFormat
Source§impl PartialEq for CodecFormat
impl PartialEq for CodecFormat
Source§fn eq(&self, other: &CodecFormat) -> bool
fn eq(&self, other: &CodecFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CodecFormat
impl Eq for CodecFormat
impl StructuralPartialEq for CodecFormat
Auto Trait Implementations§
impl Freeze for CodecFormat
impl RefUnwindSafe for CodecFormat
impl Send for CodecFormat
impl Sync for CodecFormat
impl Unpin for CodecFormat
impl UnsafeUnpin for CodecFormat
impl UnwindSafe for CodecFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.