pub struct SerdeBehaviorContract {
pub option_some_as_inner_tag: bool,
pub option_none_rejected: bool,
pub vec_u8_non_empty_as_byte_array: bool,
pub empty_vec_u8_requires_wrapper: bool,
}Expand description
Typed serde conversion contract for Option and byte vectors.
Option::Some(T)is serialized asT’s NBT tag payload.Option::Noneis rejected (NBT has no native null marker).- Non-empty
Vec<u8>is detected and encoded asTag::ByteArray. - Empty
Vec<u8>is ambiguous underserde_value(type erasure); to force byte-array semantics for empty payloads, useNbtByteArray.
Fields§
§option_some_as_inner_tag: bool§option_none_rejected: bool§vec_u8_non_empty_as_byte_array: bool§empty_vec_u8_requires_wrapper: boolTrait Implementations§
Source§impl Clone for SerdeBehaviorContract
impl Clone for SerdeBehaviorContract
Source§fn clone(&self) -> SerdeBehaviorContract
fn clone(&self) -> SerdeBehaviorContract
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SerdeBehaviorContract
impl Debug for SerdeBehaviorContract
Source§impl PartialEq for SerdeBehaviorContract
impl PartialEq for SerdeBehaviorContract
impl Copy for SerdeBehaviorContract
impl Eq for SerdeBehaviorContract
impl StructuralPartialEq for SerdeBehaviorContract
Auto Trait Implementations§
impl Freeze for SerdeBehaviorContract
impl RefUnwindSafe for SerdeBehaviorContract
impl Send for SerdeBehaviorContract
impl Sync for SerdeBehaviorContract
impl Unpin for SerdeBehaviorContract
impl UnsafeUnpin for SerdeBehaviorContract
impl UnwindSafe for SerdeBehaviorContract
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.