# NominalStreamOpts

## #[non_exhaustive] pub struct NominalStreamOpts

Configuration for a [`NominalDatasetStream`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/stream/struct.NominalDatasetStream.md "nominal_streaming::stream::NominalDatasetStream").

Marked `#[non_exhaustive]` so new options can be added without a breaking change.
Construct with `NominalStreamOpts::default` and customise via the `with_*` methods.

## Fields

### pub max_points_per_record: usize

Maximum submitted data points per output request. Must be greater than zero.
Oversized buffers are split by the background processor.

### pub max_request_delay: Duration

### pub max_buffered_requests: usize

### pub request_dispatcher_tasks: usize

Number of threads sending requests to the consumer. Must be greater than zero.

### pub base_api_url: String

### pub track_metrics: bool

Emit request runtime metrics from the builder’s Core consumer. Disabled by default.

Completed request metrics piggyback on later data requests to the same dataset.
Pending metrics are bounded and discarded on shutdown; no extra requests are sent.
File-only streams are unaffected.
Configure manually supplied consumers separately.

### pub additional_metric_channels: Vec<String>

Channels the caller emits through the stream that carry metrics rather than data,
beyond the request metrics `track_metrics` emits itself. They are excluded from
request latency measurements when `track_metrics` is enabled.

### pub user_agent: ProductAgent

Program name and version at the start of the `User-Agent` header of requests from the
Core consumer [`NominalDatasetStreamBuilder`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/stream/struct.NominalDatasetStreamBuilder.md "nominal_streaming::stream::NominalDatasetStreamBuilder") builds. See [`ProductAgent`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/client/struct.ProductAgent.md "nominal_streaming::client::ProductAgent").

Consumers passed to [`NominalDatasetStream::new_with_consumer`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/stream/struct.NominalDatasetStream.md#method.new_with_consumer "nominal_streaming::stream::NominalDatasetStream::new_with_consumer") keep the agent of the
clients they were built with. Build those clients with
[`NominalApiClients::try_from_url`](https://dev.nominal.io/nominal-streaming/ref/rust/nominal_streaming/client/struct.NominalApiClients.md#method.try_from_url "nominal_streaming::client::NominalApiClients::try_from_url").

## Implementations

### impl NominalStreamOpts

#### pub fn with_max_points_per_record(self, max_points_per_record: usize) -> Self

#### pub fn with_max_request_delay(self, max_request_delay: Duration) -> Self

#### pub fn with_max_buffered_requests(self, max_buffered_requests: usize) -> Self

#### pub fn with_request_dispatcher_tasks(self, request_dispatcher_tasks: usize) -> Self

#### pub fn with_base_api_url(self, base_api_url: impl Into<String>) -> Self

#### pub fn with_track_metrics(self, track_metrics: bool) -> Self

#### pub fn with_additional_metric_channels(self, channels: impl IntoIterator<Item = impl Into<String>>) -> Self

#### pub fn with_user_agent(self, user_agent: ProductAgent) -> Self

## Trait implementations

### impl Default for NominalStreamOpts

#### fn default() -> Self

**Derived**: [`Debug`](https://doc.rust-lang.org/1.98.1/core/fmt/trait.Debug.html), [`Clone`](https://doc.rust-lang.org/1.98.1/core/clone/trait.Clone.html)

**Auto traits**: [`Send`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html), [`Sync`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), [`Unpin`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html), [`UnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.UnwindSafe.html), [`RefUnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.RefUnwindSafe.html)
