pub struct RespLimits {
pub default_capacity: usize,
pub max_capacity: usize,
/* private fields */
}Expand description
Configuration for response processing and memory allocation limits.
Controls how response buffers are allocated and managed to balance memory usage and performance.
§Buffer Management
Based on the configured limits, response buffers are managed as follows:
// `buffer` is Vec
if buffer.capacity() > limits.max_capacity {
buffer = Vec::with_capacity(limits.default_capacity);
} else {
buffer.clear();
}When the server starts, buffers are created with a capacity equal to default_capacity.
Fields§
§default_capacity: usizeInitial buffer capacity allocated for responses (default: 1024 B)
max_capacity: usizeMaximum allowed buffer capacity for responses (default: 8192 B)
Trait Implementations§
Source§impl Clone for RespLimits
impl Clone for RespLimits
Source§fn clone(&self) -> RespLimits
fn clone(&self) -> RespLimits
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RespLimits
impl Debug for RespLimits
Auto Trait Implementations§
impl Freeze for RespLimits
impl RefUnwindSafe for RespLimits
impl Send for RespLimits
impl Sync for RespLimits
impl Unpin for RespLimits
impl UnsafeUnpin for RespLimits
impl UnwindSafe for RespLimits
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