pub struct RequestBodyLimit(/* private fields */);Available on crate feature
transport-http only.Expand description
Non-zero cap, in bytes, on a single POST request body for
HttpConfig::max_request_body, clamped to 64 MiB.
rmcp buffers a body in memory while enforcing the cap, so the
maximum bounds that buffering. A zero cap would reject every POST
body, so it is unrepresentable.
§Examples
use mcpls_core::RequestBodyLimit;
assert!(RequestBodyLimit::new(0).is_none());
assert_eq!(RequestBodyLimit::new(1024).unwrap().get(), 1024);
assert_eq!(RequestBodyLimit::DEFAULT.get(), 4 * 1024 * 1024);
assert_eq!(RequestBodyLimit::new(usize::MAX).unwrap().get(), 64 * 1024 * 1024);Implementations§
Trait Implementations§
Source§impl Clone for RequestBodyLimit
impl Clone for RequestBodyLimit
impl Copy for RequestBodyLimit
Source§impl Debug for RequestBodyLimit
impl Debug for RequestBodyLimit
impl Eq for RequestBodyLimit
Source§impl PartialEq for RequestBodyLimit
impl PartialEq for RequestBodyLimit
impl StructuralPartialEq for RequestBodyLimit
Auto Trait Implementations§
impl Freeze for RequestBodyLimit
impl RefUnwindSafe for RequestBodyLimit
impl Send for RequestBodyLimit
impl Sync for RequestBodyLimit
impl Unpin for RequestBodyLimit
impl UnsafeUnpin for RequestBodyLimit
impl UnwindSafe for RequestBodyLimit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.