pub trait HttpBodyControl: HttpControl {
    // Required method
    fn body_size(&self) -> usize;

    // Provided methods
    fn get(&self, range: impl RangeBounds<usize>) -> Option<Vec<u8>> { ... }
    fn set(&self, range: impl RangeBounds<usize>, value: &[u8]) { ... }
    fn all(&self) -> Option<Vec<u8>> { ... }
    fn replace(&self, value: &[u8]) { ... }
    fn clear(&self) { ... }
}
Expand description

Defines functions to interact with body data

Required Methods§

source

fn body_size(&self) -> usize

Length of this body fragment

Provided Methods§

source

fn get(&self, range: impl RangeBounds<usize>) -> Option<Vec<u8>>

Get a range of the body block content

source

fn set(&self, range: impl RangeBounds<usize>, value: &[u8])

Set a range of the body block content

source

fn all(&self) -> Option<Vec<u8>>

Get the entire body block content

source

fn replace(&self, value: &[u8])

Replace the entire body block with value

source

fn clear(&self)

Clear the entire body block

Object Safety§

This trait is not object safe.

Implementors§