pub struct Config { /* private fields */ }
Expand description
Configuration settings used by the deserializer.
May in future also be used by the serializer.
Implementations§
Source§impl Config
impl Config
Source§impl Config
impl Config
Sourcepub fn with_max_bytes(self, max_bytes: u32) -> Config
pub fn with_max_bytes(self, max_bytes: u32) -> Config
Specify a maximum number of response bytes to read.
Use this if you are reading data from an untrusted source. If that source then sends a very large response we will reject it rather than attempt to read it all and thus avoid possibly running out of memory.
Sourcepub fn with_read_buf(self) -> Config
pub fn with_read_buf(self) -> Config
Save the read response bytes into a buffer for use later.
Allocate a persistent buffer that can be used by a reader to store the read response bytes into. This could be to avoid allocating a buffer for every response read, or to permit logging or storing or pretty printing of the response bytes once they have been read from the source.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl !Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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