Skip to main content

StreamConfig

Struct StreamConfig 

Source
pub struct StreamConfig<D = BestEffortDelivery, R = NoReplay>
where D: Delivery, R: Replay,
{ 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: NumBytes

The 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: usize

The 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: D

How slow active subscribers affect reading from the underlying stream.

§replay: R

Whether and how replay history is retained for subscribers that attach after output arrives.

Implementations§

Source§

impl StreamConfig<BestEffortDelivery, NoReplay>

Source

pub fn builder() -> StreamConfigBuilder

Starts building an output stream configuration.

Source§

impl<D, R> StreamConfig<D, R>
where D: Delivery, R: Replay,

Source

pub fn delivery_guarantee(self) -> DeliveryGuarantee

Returns the runtime delivery guarantee represented by this configuration.

Source

pub fn replay_retention(self) -> Option<ReplayRetention>

Returns the replay retention represented by this configuration.

Source

pub fn replay_enabled(self) -> bool

Returns whether this configuration enables replay-specific APIs.

Source§

impl<D> StreamConfig<D, ReplayEnabled>
where D: Delivery,

Source

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>
where D: Delivery + Clone, R: Replay + Clone,

Source§

fn clone(&self) -> StreamConfig<D, R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D, R> Debug for StreamConfig<D, R>
where D: Delivery + Debug, R: Replay + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D, R> PartialEq for StreamConfig<D, R>

Source§

fn eq(&self, other: &StreamConfig<D, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<D, R> Copy for StreamConfig<D, R>
where D: Delivery + Copy, R: Replay + Copy,

Source§

impl<D, R> Eq for StreamConfig<D, R>
where D: Delivery + Eq, R: Replay + Eq,

Source§

impl<D, R> StructuralPartialEq for StreamConfig<D, R>
where D: Delivery, R: Replay,

Auto Trait Implementations§

§

impl<D, R> Freeze for StreamConfig<D, R>
where D: Freeze, R: Freeze,

§

impl<D, R> RefUnwindSafe for StreamConfig<D, R>

§

impl<D, R> Send for StreamConfig<D, R>

§

impl<D, R> Sync for StreamConfig<D, R>

§

impl<D, R> Unpin for StreamConfig<D, R>
where D: Unpin, R: Unpin,

§

impl<D, R> UnsafeUnpin for StreamConfig<D, R>
where D: UnsafeUnpin, R: UnsafeUnpin,

§

impl<D, R> UnwindSafe for StreamConfig<D, R>
where D: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Sink for T
where T: Send + 'static,