pub enum EncodeMode {
Verbatim,
Canonical,
}Expand description
Which form EncodeExt::encode writes. On a #[bin] message that has a reserved or
calc field, this is a settable in-memory property (encode_mode()/set_encode_mode(),
or the builder’s .encode_mode(…)) that encode consults — never written to the wire.
to_bytes/to_canonical_bytes ignore it and always encode verbatim/canonical respectively.
Variants§
Verbatim
Verbatim (default) — write exactly what’s stored (retained reserved bits, the
stored value of a calc field). Never silently rewrites the caller’s data, and is the
faithful dual of decode (so a decoded value re-encodes byte-for-byte).
Canonical
Canonical — reserved fields written as their spec value and calc fields
recomputed, so the result is always spec-compliant.
Trait Implementations§
Source§impl Clone for EncodeMode
impl Clone for EncodeMode
Source§fn clone(&self) -> EncodeMode
fn clone(&self) -> EncodeMode
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 moreimpl Copy for EncodeMode
Source§impl Debug for EncodeMode
impl Debug for EncodeMode
Source§impl Default for EncodeMode
impl Default for EncodeMode
Source§fn default() -> EncodeMode
fn default() -> EncodeMode
Returns the “default value” for a type. Read more
impl Eq for EncodeMode
Source§impl Hash for EncodeMode
impl Hash for EncodeMode
Source§impl Ord for EncodeMode
impl Ord for EncodeMode
Source§fn cmp(&self, other: &EncodeMode) -> Ordering
fn cmp(&self, other: &EncodeMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for EncodeMode
impl PartialEq for EncodeMode
Source§fn eq(&self, other: &EncodeMode) -> bool
fn eq(&self, other: &EncodeMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for EncodeMode
impl PartialOrd for EncodeMode
impl StructuralPartialEq for EncodeMode
Auto Trait Implementations§
impl Freeze for EncodeMode
impl RefUnwindSafe for EncodeMode
impl Send for EncodeMode
impl Sync for EncodeMode
impl Unpin for EncodeMode
impl UnsafeUnpin for EncodeMode
impl UnwindSafe for EncodeMode
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