pub struct OpenStreamWriterOptions {
pub progress_token: String,
pub publish_frame: PublishFrame,
pub content_type: Option<String>,
pub on_close: Option<OnCloseHook>,
pub on_abort: Option<OnAbortHook>,
pub idle_timeout: Option<Duration>,
pub probe_timeout: Duration,
}Expand description
Construction options for an OpenStreamWriter.
Fields§
§progress_token: StringThe stream id (stringified progressToken).
publish_frame: PublishFrameOutbound publisher (same seam as the session).
content_type: Option<String>Optional advisory start content type (writer-settable, receiver-ignored).
on_close: Option<OnCloseHook>Fired after a terminal close frame is published.
on_abort: Option<OnAbortHook>Fired after a terminal abort frame is published.
idle_timeout: Option<Duration>Sender-side keepalive idle window (CEP-41 §Timeout and Keepalive). None
disables keepalive (e.g. unit tests). When set, the writer arms the window
once it starts streaming and probes the peer with ping if no inbound
frame arrives within this duration; a missing pong aborts with
"Probe timeout", closing a leak where a silently-disconnected client
left the writer (and its upstream producer) alive indefinitely.
probe_timeout: DurationTime the writer waits for a matching pong after probing before aborting.
Ignored when idle_timeout is None.
Implementations§
Source§impl OpenStreamWriterOptions
impl OpenStreamWriterOptions
Sourcepub fn with_keepalive(self, idle: Duration, probe: Duration) -> Self
pub fn with_keepalive(self, idle: Duration, probe: Duration) -> Self
Enable sender-side keepalive with the given idle/probe windows.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenStreamWriterOptions
impl !UnwindSafe for OpenStreamWriterOptions
impl Freeze for OpenStreamWriterOptions
impl Send for OpenStreamWriterOptions
impl Sync for OpenStreamWriterOptions
impl Unpin for OpenStreamWriterOptions
impl UnsafeUnpin for OpenStreamWriterOptions
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more