pub struct StreamOptions { /* private fields */ }Expand description
How one stream is run. Every field has a default: the stream’s own.
Implementations§
Source§impl StreamOptions
impl StreamOptions
Sourcepub fn dedupe_window(self, ids: usize) -> Self
pub fn dedupe_window(self, ids: usize) -> Self
Event ids remembered to drop a replay’s repeats. 0 delivers every
frame.
Sourcepub fn max_frame_bytes(self, bytes: usize) -> Self
pub fn max_frame_bytes(self, bytes: usize) -> Self
Largest frame accepted, in bytes.
Sourcepub fn give_up_after(self, after: Duration) -> Self
pub fn give_up_after(self, after: Duration) -> Self
Stop with StreamErrorKind::GaveUp after this long without an open
connection. Without it the stream retries for ever.
Sourcepub fn start_after(self, wait: Duration) -> Self
pub fn start_after(self, wait: Duration) -> Self
The first connect starts this long from now, instead of at once.
Sourcepub fn on_status(
self,
on_status: impl Fn(&StreamItem) + Send + Sync + 'static,
) -> Self
pub fn on_status( self, on_status: impl Fn(&StreamItem) + Send + Sync + 'static, ) -> Self
Called for every item that is not an event, by
EventStream::next_event and the stream of events, which do not
return them.
Sourcepub fn jitter(self, jitter: impl Fn() -> f64 + Send + Sync + 'static) -> Self
pub fn jitter(self, jitter: impl Fn() -> f64 + Send + Sync + 'static) -> Self
The random number of the reconnect wait, in [0, 1). For tests.
Sourcepub fn budget(self, budget: StreamBudget) -> Self
pub fn budget(self, budget: StreamBudget) -> Self
The connect budget to draw on, instead of a new one.
Sourcepub fn or_budget(self, budget: StreamBudget) -> Self
pub fn or_budget(self, budget: StreamBudget) -> Self
The connect budget to draw on, unless one was chosen already.
Trait Implementations§
Source§impl Clone for StreamOptions
impl Clone for StreamOptions
Source§impl Debug for StreamOptions
impl Debug for StreamOptions
Auto Trait Implementations§
impl !RefUnwindSafe for StreamOptions
impl !UnwindSafe for StreamOptions
impl Freeze for StreamOptions
impl Send for StreamOptions
impl Sync for StreamOptions
impl Unpin for StreamOptions
impl UnsafeUnpin for StreamOptions
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