pub struct BodyConfig { /* private fields */ }Expand description
Configuration for HTTP request body parsing.
This struct controls how different body types (JSON, string, bytes) are processed, including size limits for each type.
§Default Settings
- JSON limit: 51,000 bytes (50 KB)
- String limit: 51,000 bytes (50 KB)
- Byte limit: 51,000 bytes (50 KB)
§Example
use foxtive_ntex::http::server::BodyConfig;
// Use default configuration
let config = BodyConfig::default();
// Custom limits for different body types
let config = BodyConfig::default()
.json_limit(1024 * 1024) // 1 MB for JSON
.string_limit(512 * 1024) // 512 KB for strings
.byte_limit(2 * 1024 * 1024); // 2 MB for bytesImplementations§
Source§impl BodyConfig
impl BodyConfig
pub fn json_limit(self, limit: usize) -> Self
pub fn string_limit(self, limit: usize) -> Self
pub fn byte_limit(self, limit: usize) -> Self
Trait Implementations§
Source§impl Clone for BodyConfig
impl Clone for BodyConfig
Source§fn clone(&self) -> BodyConfig
fn clone(&self) -> BodyConfig
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 BodyConfig
impl Debug for BodyConfig
Auto Trait Implementations§
impl Freeze for BodyConfig
impl RefUnwindSafe for BodyConfig
impl Send for BodyConfig
impl Sync for BodyConfig
impl Unpin for BodyConfig
impl UnsafeUnpin for BodyConfig
impl UnwindSafe for BodyConfig
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