#[non_exhaustive]pub enum BytesMode {
Normal,
ForceIterables,
ForceAll,
}
Expand description
When to encode [u8]
as bytes
rather than a sequence
of integers. Serde without serde_bytes
has trouble
using bytes
, and this is hack to force it. It may
break some data types.
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.
Normal
Use bytes only when Serde requires it
(typically only when serde_bytes
is used)
ForceIterables
Use bytes for slices, Vec
, and a few other types that
use Iterator
in Serde.
This may break some implementations of Deserialize
.
This does not include fixed-length arrays.
ForceAll
Use bytes for everything that looks like a container of u8
.
This breaks some implementations of Deserialize
.
Trait Implementations§
source§impl PartialEq for BytesMode
impl PartialEq for BytesMode
impl Copy for BytesMode
impl Eq for BytesMode
impl StructuralPartialEq for BytesMode
Auto Trait Implementations§
impl Freeze for BytesMode
impl RefUnwindSafe for BytesMode
impl Send for BytesMode
impl Sync for BytesMode
impl Unpin for BytesMode
impl UnwindSafe for BytesMode
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