pub struct StreamConfig { /* private fields */ }Expand description
Configuration for streaming responses.
Implementations§
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn with_chunk_size(self, size: usize) -> Self
pub fn with_chunk_size(self, size: usize) -> Self
Set the chunk size for reading.
Sourcepub fn with_max_buffer_size(self, size: usize) -> Self
pub fn with_max_buffer_size(self, size: usize) -> Self
Set the maximum buffer size for backpressure.
Sourcepub fn with_checkpoint(self, enabled: bool) -> Self
pub fn with_checkpoint(self, enabled: bool) -> Self
Enable or disable checkpoint calls between chunks.
Sourcepub fn chunk_size(&self) -> usize
pub fn chunk_size(&self) -> usize
Returns the chunk size.
Sourcepub fn max_buffer_size(&self) -> usize
pub fn max_buffer_size(&self) -> usize
Returns the maximum buffer size.
Sourcepub fn checkpoint_enabled(&self) -> bool
pub fn checkpoint_enabled(&self) -> bool
Returns whether checkpoints are enabled.
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
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 StreamConfig
impl Debug for StreamConfig
Auto Trait Implementations§
impl Freeze for StreamConfig
impl RefUnwindSafe for StreamConfig
impl Send for StreamConfig
impl Sync for StreamConfig
impl Unpin for StreamConfig
impl UnwindSafe for StreamConfig
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).