Enum zenoh_protocol_core::Encoding
source · [−]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
sourceimpl Encoding
impl Encoding
pub fn new<IntoCowStr>(prefix: ZInt, suffix: IntoCowStr) -> Option<Self>where
IntoCowStr: Into<Cow<'static, str>> + AsRef<str>,
sourcepub fn with_suffix<IntoCowStr>(self, suffix: IntoCowStr) -> Selfwhere
IntoCowStr: Into<Cow<'static, str>>,
pub fn with_suffix<IntoCowStr>(self, suffix: IntoCowStr) -> Selfwhere
IntoCowStr: Into<Cow<'static, str>>,
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) -> boolwhere
T: Into<Encoding>,
pub fn starts_with<T>(&self, with: T) -> boolwhere
T: Into<Encoding>,
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
sourceimpl 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
sourceimpl From<&KnownEncoding> for Encoding
impl From<&KnownEncoding> for Encoding
sourcefn from(e: &KnownEncoding) -> Encoding
fn from(e: &KnownEncoding) -> Encoding
Converts to this type from the input type.
sourceimpl From<KnownEncoding> for Encoding
impl From<KnownEncoding> for Encoding
sourcefn from(e: KnownEncoding) -> Encoding
fn from(e: KnownEncoding) -> Encoding
Converts to this type from the input type.
impl Eq for Encoding
impl StructuralEq for Encoding
impl StructuralPartialEq for Encoding
Auto Trait Implementations
impl RefUnwindSafe for Encoding
impl Send for Encoding
impl Sync for Encoding
impl Unpin for Encoding
impl UnwindSafe for Encoding
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more