pub struct StreamOptionsBuilder { /* private fields */ }Expand description
Builder for StreamOptions.
Implementations§
Source§impl StreamOptionsBuilder
impl StreamOptionsBuilder
Sourcepub fn poll_interval(self, interval: Duration) -> Self
pub fn poll_interval(self, interval: Duration) -> Self
Set the polling interval.
Sourcepub fn buffer_size(self, size: usize) -> Self
pub fn buffer_size(self, size: usize) -> Self
Set the buffer size.
Sourcepub fn include_errors(self, include: bool) -> Self
pub fn include_errors(self, include: bool) -> Self
Set whether to include errors in the stream.
When true, read errors are sent as Err(Error) items to the stream,
allowing consumers to detect disconnections and other issues.
Sourcepub fn max_consecutive_failures(self, max: u32) -> Self
pub fn max_consecutive_failures(self, max: u32) -> Self
Set the maximum consecutive failures before auto-closing.
When set, the stream will automatically close after this many consecutive read failures, indicating a likely disconnection.
Sourcepub fn build(self) -> StreamOptions
pub fn build(self) -> StreamOptions
Build the StreamOptions.
Trait Implementations§
Source§impl Clone for StreamOptionsBuilder
impl Clone for StreamOptionsBuilder
Source§fn clone(&self) -> StreamOptionsBuilder
fn clone(&self) -> StreamOptionsBuilder
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 StreamOptionsBuilder
impl Debug for StreamOptionsBuilder
Source§impl Default for StreamOptionsBuilder
impl Default for StreamOptionsBuilder
Source§fn default() -> StreamOptionsBuilder
fn default() -> StreamOptionsBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamOptionsBuilder
impl RefUnwindSafe for StreamOptionsBuilder
impl Send for StreamOptionsBuilder
impl Sync for StreamOptionsBuilder
impl Unpin for StreamOptionsBuilder
impl UnwindSafe for StreamOptionsBuilder
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