Struct bonsaidb::core::transmog_pot::pot::Config
pub struct Config { /* private fields */ }
Expand description
Serialization and deserialization configuration.
Implementations§
§impl Config
impl Config
pub const fn allocation_budget(self, budget: usize) -> Config
pub const fn allocation_budget(self, budget: usize) -> Config
Sets the maximum number of bytes able to be allocated. This is not guaranteed to be perfectly accurate, due to the limitations of serde deserializers. Pot can keep track of how many bytes it thinks its allocating, but a deserializer can always allocate more memory than Pot can be aware of.
The default allocation budget is usize::MAX
.
pub fn deserialize<'de, T>(&self, serialized: &'de [u8]) -> Result<T, Error>where
T: Deserialize<'de>,
pub fn deserialize<'de, T>(&self, serialized: &'de [u8]) -> Result<T, Error>where
T: Deserialize<'de>,
Deserializes a value from a slice using the configured options.
pub fn deserialize_from<T, R>(&self, reader: R) -> Result<T, Error>where
R: Read,
T: DeserializeOwned,
pub fn deserialize_from<T, R>(&self, reader: R) -> Result<T, Error>where
R: Read,
T: DeserializeOwned,
Deserializes a value from a Read
implementer using the configured
options.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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