pub enum Encoding {
Exact(KnownEncoding),
WithSuffix(KnownEncoding, Cow<'static, str>),
}
Expand description
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, Cow<'static, str>)
Implementations§
Source§impl Encoding
impl Encoding
pub fn new<IntoCowStr>(prefix: ZInt, suffix: IntoCowStr) -> Option<Self>
Sourcepub fn with_suffix<IntoCowStr>(self, suffix: IntoCowStr) -> Self
pub fn with_suffix<IntoCowStr>(self, suffix: IntoCowStr) -> Self
Sets the suffix of this encoding.
pub fn as_ref<'a, T>(&'a self) -> Twhere
&'a Self: Into<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.
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