pub struct StreamingBodyConfig {
pub streaming_threshold: usize,
pub chunk_size: usize,
pub max_size: usize,
}Expand description
Configuration for async body streaming.
Fields§
§streaming_threshold: usizeThreshold above which bodies are streamed.
chunk_size: usizeSize of each read chunk.
max_size: usizeMaximum body size (enforced during streaming).
Implementations§
Source§impl StreamingBodyConfig
impl StreamingBodyConfig
Sourcepub fn with_streaming_threshold(self, threshold: usize) -> Self
pub fn with_streaming_threshold(self, threshold: usize) -> Self
Set the streaming threshold.
Sourcepub fn with_chunk_size(self, size: usize) -> Self
pub fn with_chunk_size(self, size: usize) -> Self
Set the chunk size for reads.
Note: For network efficiency, values below 1KB are allowed but not recommended for production use.
Sourcepub fn with_max_size(self, size: usize) -> Self
pub fn with_max_size(self, size: usize) -> Self
Set the maximum body size.
Sourcepub fn should_stream(&self, content_length: usize) -> bool
pub fn should_stream(&self, content_length: usize) -> bool
Returns true if the given content length should be streamed.
Trait Implementations§
Source§impl Clone for StreamingBodyConfig
impl Clone for StreamingBodyConfig
Source§fn clone(&self) -> StreamingBodyConfig
fn clone(&self) -> StreamingBodyConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 StreamingBodyConfig
impl Debug for StreamingBodyConfig
Auto Trait Implementations§
impl Freeze for StreamingBodyConfig
impl RefUnwindSafe for StreamingBodyConfig
impl Send for StreamingBodyConfig
impl Sync for StreamingBodyConfig
impl Unpin for StreamingBodyConfig
impl UnwindSafe for StreamingBodyConfig
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).