Struct http_serve::StreamingBodyBuilder
source · [−]pub struct StreamingBodyBuilder { /* private fields */ }
Expand description
A builder returned by streaming_body.
Implementations
sourceimpl StreamingBodyBuilder
impl StreamingBodyBuilder
sourcepub fn with_chunk_size(self, chunk_size: usize) -> Self
pub fn with_chunk_size(self, chunk_size: usize) -> Self
Sets the size of a data chunk.
This is a compromise between memory usage and efficiency. The default of 4096 is usually fine; increasing will likely only be noticeably more efficient when compression is off.
sourcepub fn with_gzip_level(self, gzip_level: u32) -> Self
pub fn with_gzip_level(self, gzip_level: u32) -> Self
Sets the gzip compression level. Defaults to 6.
gzip_level
should be an integer between 0 and 9 (inclusive).
0 means no compression; 9 gives the best compression (but most CPU usage).
This is only effective if the client supports compression.
Auto Trait Implementations
impl RefUnwindSafe for StreamingBodyBuilder
impl Send for StreamingBodyBuilder
impl Sync for StreamingBodyBuilder
impl Unpin for StreamingBodyBuilder
impl UnwindSafe for StreamingBodyBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more