pub struct SseConfig {
pub retry: u64,
pub max_buffer_size: usize,
pub compression: bool,
pub headers: HashMap<String, String>,
}Expand description
Configuration for SSE connections.
Fields§
§retry: u64Reconnection retry interval in milliseconds
max_buffer_size: usizeMaximum in-flight bytes a parser may retain.
SseParser::new takes its bound from this field’s DEFAULT value, and
SseParser::with_max_buffer_size overrides it per parser. It covers
BOTH of the parser’s accumulators — the unterminated line in its buffer
and the data: payload of the event still awaiting its blank line. A
chunk that would push that total past the bound is discarded whole and
latches SseParser::overflowed, so no peer can grow the process’s heap
without limit by holding a stream open, whether or not it sends newlines.
compression: boolEnable compression
headers: HashMap<String, String>Custom headers
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 UnsafeUnpin 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