pub struct SseOptions {
pub resume_from: Option<u64>,
pub heartbeat: Option<Duration>,
pub retry: Option<Duration>,
}Expand description
Options for agent_sse_frames.
Fields§
§resume_from: Option<u64>Suppress frames whose id is at or below this value (SSE Last-Event-ID).
heartbeat: Option<Duration>When set, emit a : keep-alive comment whenever no event arrives for
this long.
retry: Option<Duration>When set, the first content frame carries an SSE retry: hint.
Implementations§
Source§impl SseOptions
impl SseOptions
Sourcepub fn with_resume_from(self, last_event_id: u64) -> Self
pub fn with_resume_from(self, last_event_id: u64) -> Self
Suppresses frames at or below last_event_id (SSE Last-Event-ID).
Sourcepub fn with_heartbeat(self, interval: Duration) -> Self
pub fn with_heartbeat(self, interval: Duration) -> Self
Emits keep-alive comments on idle connections at the given interval.
Sourcepub fn with_retry(self, retry: Duration) -> Self
pub fn with_retry(self, retry: Duration) -> Self
Sends the SSE retry: reconnection hint on the first content frame.
Trait Implementations§
Source§impl Clone for SseOptions
impl Clone for SseOptions
Source§fn clone(&self) -> SseOptions
fn clone(&self) -> SseOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SseOptions
impl Debug for SseOptions
Source§impl Default for SseOptions
impl Default for SseOptions
Source§fn default() -> SseOptions
fn default() -> SseOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SseOptions
impl RefUnwindSafe for SseOptions
impl Send for SseOptions
impl Sync for SseOptions
impl Unpin for SseOptions
impl UnsafeUnpin for SseOptions
impl UnwindSafe for SseOptions
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