pub fn limit(self, limit: usize) -> Self {
        match self {
            JsonBody::Body {
                length,
                payload,
                buf,
                ..
            } => {
                if let Some(len) = length {
                    if len > limit {
                        return JsonBody::Error(Some(JsonPayloadError::OverflowKnownLength {
                            length: len,
                            limit,
                        }));
                    }
                }

                JsonBody::Body {
                    limit,
                    length,
                    payload,
                    buf,
                    _res: PhantomData,
                }
            }
            JsonBody::Error(e) => JsonBody::Error(e),
        }
    }
/// Set maximum accepted payload size. The default limit is 2MB.
Set maximum accepted payload size. The default limit is 2MB.
Set maximum accepted payload size . The default limit is 2MB .
pub fn limit(self, limit: usize) -> Self {
        match self {
            JsonBody::Body {
                length,
                payload,
                buf,
                ..
            } => {
                if let Some(len) = length {
                    if len > limit {
                        return JsonBody::Error(Some(JsonPayloadError::OverflowKnownLength {
                            length: len,
                            limit,
                        }));
                    }
                }
                JsonBody::Body {
                    limit,
                    length,
                    payload,
                    buf,
                    _res: PhantomData,
                }
            }
            JsonBody::Error(e) => JsonBody::Error(e),
        }
    }
pub fn limit ( self , limit : usize ) -> Self { match self { JsonBody :: Body { length , payload , buf , .. } => { if let Some ( len ) = length { if len > limit { return JsonBody :: Error ( Some ( JsonPayloadError :: OverflowKnownLength { length : len , limit , } ) ) ; } } JsonBody :: Body { limit , length , payload , buf , _res : PhantomData , } } JsonBody :: Error ( e ) => JsonBody :: Error ( e ) , } }
Set maximum accepted payload size.
Set maximum accepted payload size .
self
limit
usize
self
limit
usize