pub fn new(body: B, max_bytes: usize) -> Self {
        let was_empty = body.is_end_stream();
        Self {
            state: Some(BodyState {
                buf: Default::default(),
                trailers: None,
                rest: Some(body),
                is_completed: false,
                max_bytes: max_bytes + 1,
            }),
            shared: Arc::new(SharedState {
                body: Mutex::new(None),
                was_empty,
            }),
            // The initial `ReplayBody` has nothing to replay
            replay_body: false,
            replay_trailers: false,
        }
    }
/// Wraps an initial `Body` in a `ReplayBody`.
///
/// In order to prevent unbounded buffering, this takes a maximum number of
/// bytes to buffer as a second parameter. If more than than that number of
/// bytes would be buffered, the buffered data is discarded and any
/// subsequent clones of this body will fail. However, the *currently
/// active* clone of the body is allowed to continue without erroring. It
/// will simply stop buffering any additional data for retries.
Wraps an initial `Body` in a `ReplayBody`.
In order to prevent unbounded buffering, this takes a maximum number of
bytes to buffer as a second parameter. If more than than that number of
bytes would be buffered, the buffered data is discarded and any
subsequent clones of this body will fail. However, the *currently
active* clone of the body is allowed to continue without erroring. It
will simply stop buffering any additional data for retries.
Wraps an initial ` Body ` in a ` ReplayBody ` . In order to prevent unbounded buffering this takes a maximum number of bytes to buffer as a second parameter . If more than than that number of bytes would be buffered the buffered data is discarded and any subsequent clones of this body will fail . However the * currently active * clone of the body is allowed to continue without erroring . It will simply stop buffering any additional data for retries .
pub fn new(body: B, max_bytes: usize) -> Self {
        let was_empty = body.is_end_stream();
        Self {
            state: Some(BodyState {
                buf: Default::default(),
                trailers: None,
                rest: Some(body),
                is_completed: false,
                max_bytes: max_bytes + 1,
            }),
            shared: Arc::new(SharedState {
                body: Mutex::new(None),
                was_empty,
            }),
            // The initial `ReplayBody` has nothing to replay
            replay_body: false,
            replay_trailers: false,
        }
    }
pub fn new ( body : B , max_bytes : usize ) -> Self { let was_empty = body . is_end_stream ( ) ; Self { state : Some ( BodyState { buf : Default :: default ( ) , trailers : None , rest : Some ( body ) , is_completed : false , max_bytes : max_bytes + 1 , } ) , shared : Arc :: new ( SharedState { body : Mutex :: new ( None ) , was_empty , } ) , // The initial `ReplayBody` has nothing to replay replay_body : false , replay_trailers : false , } }
Wraps an initial `Body` in a `ReplayBody`.
Wraps an initial ` Body ` in a ` ReplayBody ` .
body
B
max_bytes
usize
body
B
max_bytes
usize