pub struct BDecodeOpt { /* private fields */ }
Expand description
Stores decoding options for modifying decode behavior.
Implementations§
Source§impl BDecodeOpt
impl BDecodeOpt
Sourcepub fn new(
max_recursion: usize,
check_key_sort: bool,
enforce_full_decode: bool,
) -> BDecodeOpt
pub fn new( max_recursion: usize, check_key_sort: bool, enforce_full_decode: bool, ) -> BDecodeOpt
Create a new BDecodeOpt
object.
Sourcepub fn max_recursion(&self) -> usize
pub fn max_recursion(&self) -> usize
Maximum limit allowed when decoding bencode.
Sourcepub fn check_key_sort(&self) -> bool
pub fn check_key_sort(&self) -> bool
Whether or not an error should be thrown for out of order dictionary keys.
Sourcepub fn enforce_full_decode(&self) -> bool
pub fn enforce_full_decode(&self) -> bool
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§
Source§impl Clone for BDecodeOpt
impl Clone for BDecodeOpt
Source§fn clone(&self) -> BDecodeOpt
fn clone(&self) -> BDecodeOpt
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for BDecodeOpt
impl Default for BDecodeOpt
Source§fn default() -> BDecodeOpt
fn default() -> BDecodeOpt
Returns the “default value” for a type. Read more
impl Copy for BDecodeOpt
Auto Trait Implementations§
impl Freeze for BDecodeOpt
impl RefUnwindSafe for BDecodeOpt
impl Send for BDecodeOpt
impl Sync for BDecodeOpt
impl Unpin for BDecodeOpt
impl UnwindSafe for BDecodeOpt
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