Struct probor::Config
[−]
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, }
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: usize
Maximum number of array elements
max_len_bytes: usize
Maximum length of a byte string
max_len_text: usize
Maximum length of a string
max_size_map: usize
Maximum number of object fields
max_nesting: usize
Maximum recursion steps when decoder Value
s
Ignore Tag
s when decoding Value
s
Validate Value
type matches Tag
.
Methods
impl Config
fn default() -> Config
Create default configuration with
max_len_array
= 1000max_len_bytes
= 5 MBmax_len_text
= 5 MBmax_size_map
= 1000max_nesting
= 16skip_tags
= falsecheck_tags
= true
Trait Implementations
impl Clone for Config
impl Eq for Config
impl Debug for Config
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.