Skip to main content

StreamRequestFactory

Trait StreamRequestFactory 

Source
pub trait StreamRequestFactory: Send + 'static {
    // Required method
    fn build(
        &self,
        last_event_id: Option<&str>,
    ) -> Result<RequestBuilder, TransportError>;
}
Expand description

Builder for an SSE request that can be re-issued on reconnect.

build receives the latest seen Last-Event-ID (or None on the first attempt) and must return a fresh, configured RequestBuilder. Implementations should set the Last-Event-ID header from the parameter when present.

Required Methods§

Source

fn build( &self, last_event_id: Option<&str>, ) -> Result<RequestBuilder, TransportError>

Construct a RequestBuilder for the next stream attempt.

§Errors

Returns TransportError when the factory cannot produce a builder (e.g. URL composition or auth header attachment fails).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§