pub struct SseConfig {
pub keep_alive_secs: u64,
pub keep_alive_comment: String,
}Expand description
Configuration for SSE responses.
Fields§
§keep_alive_secs: u64Keep-alive interval in seconds (0 = disabled).
keep_alive_comment: StringComment to send for keep-alive.
Implementations§
Source§impl SseConfig
impl SseConfig
Sourcepub fn keep_alive_secs(self, seconds: u64) -> Self
pub fn keep_alive_secs(self, seconds: u64) -> Self
Set the keep-alive interval.
Sourcepub fn disable_keep_alive(self) -> Self
pub fn disable_keep_alive(self) -> Self
Disable keep-alive.
Sourcepub fn keep_alive_comment(self, comment: impl Into<String>) -> Self
pub fn keep_alive_comment(self, comment: impl Into<String>) -> Self
Set the keep-alive comment text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SseConfig
impl RefUnwindSafe for SseConfig
impl Send for SseConfig
impl Sync for SseConfig
impl Unpin for SseConfig
impl UnwindSafe for SseConfig
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).