pub struct Config {
pub max_len_array: usize,
pub max_len_bytes: usize,
pub max_len_text: usize,
pub max_size_map: usize,
pub max_nesting: usize,
pub skip_tags: bool,
pub check_tags: bool,
}Expand description
Config contains various settings which limit resource consumption
or enable certain validation options. Please note that the various
maximum length/size values apply to an individual element only.
This is mainly to prevent attackers from providing CBOR values whose
length is larger than the available memory. In combination the memory
consumption can still become large and it is best to limit the incoming
bytes to a specific upper bound, e.g. by using std::io::Take.
Fields§
§max_len_array: usizeMaximum number of array elements
max_len_bytes: usizeMaximum length of a byte string
max_len_text: usizeMaximum length of a string
max_size_map: usizeMaximum number of object fields
max_nesting: usizeMaximum recursion steps when decoder Values
Ignore Tags when decoding Values
Validate Value type matches Tag.
Implementations§
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
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