pub enum Encoding {
Exact(KnownEncoding),
WithSuffix(KnownEncoding, CowStr<'static>),
}
Expand description
The encoding of a zenoh Value
.
The encoding of a zenoh zenoh::Value
.
A zenoh encoding is a HTTP Mime type represented, for wire efficiency, as an integer prefix (that maps to a string) and a string suffix.
Variants§
Exact(KnownEncoding)
WithSuffix(KnownEncoding, CowStr<'static>)
Implementations§
source§impl Encoding
impl Encoding
pub fn new<IntoCowStr>( prefix: u8, suffix: IntoCowStr ) -> Result<Encoding, Box<dyn Error + Send + Sync>>
sourcepub fn with_suffix<IntoCowStr>(
self,
suffix: IntoCowStr
) -> Result<Encoding, Box<dyn Error + Send + Sync>>
pub fn with_suffix<IntoCowStr>( self, suffix: IntoCowStr ) -> Result<Encoding, Box<dyn Error + Send + Sync>>
Sets the suffix of this encoding.
pub fn as_ref<'a, T>(&'a self) -> T
sourcepub fn starts_with<T>(&self, with: T) -> bool
pub fn starts_with<T>(&self, with: T) -> bool
Returns true
if the string representation of this encoding starts with
the string representation of ther given encoding.
pub const fn prefix(&self) -> &KnownEncoding
pub fn suffix(&self) -> &str
source§impl Encoding
impl Encoding
pub const EMPTY: Encoding = _
pub const APP_OCTET_STREAM: Encoding = _
pub const APP_CUSTOM: Encoding = _
pub const TEXT_PLAIN: Encoding = _
pub const APP_PROPERTIES: Encoding = _
pub const APP_JSON: Encoding = _
pub const APP_SQL: Encoding = _
pub const APP_INTEGER: Encoding = _
pub const APP_FLOAT: Encoding = _
pub const APP_XML: Encoding = _
pub const APP_XHTML_XML: Encoding = _
pub const APP_XWWW_FORM_URLENCODED: Encoding = _
pub const TEXT_JSON: Encoding = _
pub const TEXT_HTML: Encoding = _
pub const TEXT_XML: Encoding = _
pub const TEXT_CSS: Encoding = _
pub const TEXT_CSV: Encoding = _
pub const TEXT_JAVASCRIPT: Encoding = _
pub const IMAGE_JPEG: Encoding = _
pub const IMAGE_PNG: Encoding = _
pub const IMAGE_GIF: Encoding = _
Trait Implementations§
source§impl From<&KnownEncoding> for Encoding
impl From<&KnownEncoding> for Encoding
source§fn from(e: &KnownEncoding) -> Encoding
fn from(e: &KnownEncoding) -> Encoding
Converts to this type from the input type.
source§impl From<KnownEncoding> for Encoding
impl From<KnownEncoding> for Encoding
source§fn from(e: KnownEncoding) -> Encoding
fn from(e: KnownEncoding) -> Encoding
Converts to this type from the input type.
source§impl PartialEq for Encoding
impl PartialEq for Encoding
impl Eq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations§
impl Freeze for Encoding
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnwindSafe for Encoding
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<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.