pub struct ParseOptions {
pub max_key_len: usize,
pub max_value_len: usize,
pub max_keys: usize,
}Expand description
Configuration options for command parsing.
These options allow customizing the DoS protection limits for different deployment scenarios. More restrictive limits provide better protection against resource exhaustion attacks.
Fields§
§max_key_len: usizeMaximum key size in bytes.
max_value_len: usizeMaximum value size in bytes.
max_keys: usizeMaximum number of keys in a multi-GET command.
Implementations§
Source§impl ParseOptions
impl ParseOptions
Sourcepub const fn max_key_len(self, len: usize) -> Self
pub const fn max_key_len(self, len: usize) -> Self
Set the maximum key length.
Sourcepub const fn max_value_len(self, len: usize) -> Self
pub const fn max_value_len(self, len: usize) -> Self
Set the maximum value length.
Sourcepub const fn max_keys(self, count: usize) -> Self
pub const fn max_keys(self, count: usize) -> Self
Set the maximum number of keys in a multi-GET command.
Sourcepub const fn max_line_len(&self) -> usize
pub const fn max_line_len(&self) -> usize
Calculate the maximum command line length based on the configured limits.
The longest line is a multi-GET with max_keys keys of max_key_len each:
get <key1> <key2> ... <keyN>\r\n
Trait Implementations§
Source§impl Clone for ParseOptions
impl Clone for ParseOptions
Source§fn clone(&self) -> ParseOptions
fn clone(&self) -> ParseOptions
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 Debug for ParseOptions
impl Debug for ParseOptions
Source§impl Default for ParseOptions
impl Default for ParseOptions
impl Copy for ParseOptions
Auto Trait Implementations§
impl Freeze for ParseOptions
impl RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl UnsafeUnpin for ParseOptions
impl UnwindSafe for ParseOptions
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