pub struct Limits {
pub max_multibulk: usize,
pub max_bulk: usize,
pub max_inline: usize,
pub max_depth: usize,
}Expand description
The bounds the codec enforces, which are Redis’s bounds.
These are not tuning knobs, they are the difference between a protocol error and an allocation the size of whatever a stranger asked for. A count line saying two billion arguments has to be refused before anything is reserved for it, which is why the multibulk limit is checked against the parsed number and not against what arrives.
Fields§
§max_multibulk: usizeThe largest * count accepted. Redis’s PROTO_MAX_MULTIBULK.
max_bulk: usizeThe largest $ length accepted. Redis’s proto-max-bulk-len, which is
configurable there and so is configurable here.
max_inline: usizeThe longest an inline request or an unterminated count line may get
before it is refused. Redis’s PROTO_INLINE_MAX_SIZE.
max_depth: usizeHow deeply a reply may nest before the decoder gives up.
Redis has no equivalent because Redis never parses a reply. This exists
because the reply decoder recurses, and *1\r\n repeated a million
times would otherwise be a stack overflow rather than an error. There is
no legitimate reply anywhere near this deep.
Implementations§
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more