Struct bip_bencode::BDecodeOpt
[−]
[src]
pub struct BDecodeOpt { /* fields omitted */ }
Stores decoding options for modifying decode behavior.
Methods
impl BDecodeOpt
[src]
fn new(
max_recursion: usize,
check_key_sort: bool,
enforce_full_decode: bool
) -> BDecodeOpt
[src]
max_recursion: usize,
check_key_sort: bool,
enforce_full_decode: bool
) -> BDecodeOpt
Create a new BDecodeOpt
object.
fn max_recursion(&self) -> usize
[src]
Maximum limit allowed when decoding bencode.
fn check_key_sort(&self) -> bool
[src]
Whether or not an error should be thrown for out of order dictionary keys.
fn enforce_full_decode(&self) -> bool
[src]
Whether or not we enforce that the decoded bencode must make up all of the input bytes or not.
It may be useful to disable this if for example, the input bencode is prepended to some payload and you would like to disassociate it. In this case, to find where the rest of the payload starts that wasn't decoded, get the bencode buffer, and call len().
Trait Implementations
impl Copy for BDecodeOpt
[src]
impl Clone for BDecodeOpt
[src]
fn clone(&self) -> BDecodeOpt
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for BDecodeOpt
[src]
fn default() -> BDecodeOpt
[src]
Returns the "default value" for a type. Read more