#[non_exhaustive]pub struct Options {
pub deny_unsupported_types: bool,
pub deny_recursive_tables: bool,
pub sort_keys: bool,
}
Available on crate feature
serialize
only.Expand description
A struct with options to change default deserializer behavior.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.deny_unsupported_types: bool
If true, an attempt to serialize types such as Function
, Thread
, LightUserData
and Error
will cause an error.
Otherwise these types skipped when iterating or serialized as unit type.
Default: true
deny_recursive_tables: bool
If true, an attempt to serialize a recursive table (table that refers to itself) will cause an error. Otherwise subsequent attempts to serialize the same table will be ignored.
Default: true
sort_keys: bool
If true, keys in tables will be iterated in sorted order.
Default: false
Implementations§
source§impl Options
impl Options
sourcepub const fn deny_unsupported_types(self, enabled: bool) -> Self
pub const fn deny_unsupported_types(self, enabled: bool) -> Self
Sets deny_unsupported_types
option.
sourcepub const fn deny_recursive_tables(self, enabled: bool) -> Self
pub const fn deny_recursive_tables(self, enabled: bool) -> Self
Sets deny_recursive_tables
option.
Trait Implementations§
impl Copy for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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