pub struct DeOptions { /* private fields */ }Expand description
Options for deserializing.
Implementations§
Source§impl DeOptions
impl DeOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Construct with default options:
- don’t decode strings saved as STRING opcodes (only protocols 0-2) as UTF-8
- don’t keep restore state for unpickling class instances
- don’t replace unresolvable globals by
None, but error out - don’t replace recursive structures by
None, but error out
Sourcepub fn decode_strings(self) -> Self
pub fn decode_strings(self) -> Self
Activate decoding strings saved as STRING.
Sourcepub fn keep_restore_state(self) -> Self
pub fn keep_restore_state(self) -> Self
Activate keeping “restore state” for unpickling class instances, instead of replacing it by an empty dict.
Sourcepub fn replace_unresolved_globals(self) -> Self
pub fn replace_unresolved_globals(self) -> Self
Activate replacing unresolved globals by None, instead of erroring out.
Sourcepub fn replace_recursive_structures(self) -> Self
pub fn replace_recursive_structures(self) -> Self
Activate replacing recursive structures by None, instead of erroring out.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeOptions
impl RefUnwindSafe for DeOptions
impl Send for DeOptions
impl Sync for DeOptions
impl Unpin for DeOptions
impl UnwindSafe for DeOptions
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