Struct pot::Config [−][src]
pub struct Config { /* fields omitted */ }
Expand description
Serialization and deserialization configuration.
Implementations
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> where
T: Deserialize<'de>,
pub fn deserialize<'de, T>(&self, serialized: &'de [u8]) -> Result<T> where
T: Deserialize<'de>,
Deserializes a value from a slice using the configured options.
pub fn deserialize_from<'de, T, R: Read + 'de>(&self, reader: R) -> Result<T> where
T: Deserialize<'de>,
pub fn deserialize_from<'de, T, R: Read + 'de>(&self, reader: R) -> Result<T> where
T: Deserialize<'de>,
Deserializes a value from a Read
implementor using the configured
options.
Serializes a value to a Vec
using the configured options.
pub fn serialize_into<T, W>(&self, value: &T, writer: W) -> Result<()> where
T: Serialize,
W: WriteBytesExt,
pub fn serialize_into<T, W>(&self, value: &T, writer: W) -> Result<()> where
T: Serialize,
W: WriteBytesExt,
Serializes a value to a writer using the configured options.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl UnwindSafe for Config
Blanket Implementations
Mutably borrows from an owned value. Read more