pub struct StreamConfig<D = BestEffortDelivery, R = NoReplay>{
pub read_chunk_size: NumBytes,
pub max_buffered_chunks: usize,
pub delivery: D,
pub replay: R,
}Expand description
Shared output stream configuration for all stream backends.
Backend selection controls whether a stream has one active owner or can fan out to multiple consumers. This configuration controls delivery, replay, and buffering for whichever backend is selected.
Fields§
§read_chunk_size: NumBytesThe size of an individual chunk read from the underlying process stream.
Must be greater than zero. The default is crate::DEFAULT_READ_CHUNK_SIZE.
max_buffered_chunks: usizeThe number of chunks held by the underlying async channel.
Must be greater than zero. The default is crate::DEFAULT_MAX_BUFFERED_CHUNKS.
With DeliveryGuarantee::ReliableForActiveSubscribers, it is the maximum unread chunk
lag an active subscriber can have before reading waits.
delivery: DHow slow active subscribers affect reading from the underlying stream.
replay: RWhether and how replay history is retained for subscribers that attach after output arrives.
Implementations§
Source§impl StreamConfig<BestEffortDelivery, NoReplay>
impl StreamConfig<BestEffortDelivery, NoReplay>
Sourcepub fn builder() -> StreamConfigBuilder
pub fn builder() -> StreamConfigBuilder
Starts building an output stream configuration.
Source§impl<D, R> StreamConfig<D, R>
impl<D, R> StreamConfig<D, R>
Sourcepub fn delivery_guarantee(self) -> DeliveryGuarantee
pub fn delivery_guarantee(self) -> DeliveryGuarantee
Returns the runtime delivery guarantee represented by this configuration.
Sourcepub fn replay_retention(self) -> Option<ReplayRetention>
pub fn replay_retention(self) -> Option<ReplayRetention>
Returns the replay retention represented by this configuration.
Sourcepub fn replay_enabled(self) -> bool
pub fn replay_enabled(self) -> bool
Returns whether this configuration enables replay-specific APIs.
Source§impl<D> StreamConfig<D, ReplayEnabled>where
D: Delivery,
impl<D> StreamConfig<D, ReplayEnabled>where
D: Delivery,
Sourcepub fn with_replay_retention(self, replay_retention: ReplayRetention) -> Self
pub fn with_replay_retention(self, replay_retention: ReplayRetention) -> Self
Returns this replay-enabled configuration with custom replay retention.
Trait Implementations§
Source§impl<D, R> Clone for StreamConfig<D, R>
impl<D, R> Clone for StreamConfig<D, R>
Source§fn clone(&self) -> StreamConfig<D, R>
fn clone(&self) -> StreamConfig<D, R>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more