Rust

config

Module

Stream and consumer configuration, as the JetStream API reads and writes it.

Contents

use utopia_nats::jetstream::config::ConsumerConfig;
Rust
pub struct ConsumerConfig

A consumer's configuration. Durations are in seconds.

use utopia_nats::jetstream::config::ConsumerLimits;
Rust
pub struct ConsumerLimits

Limits a stream sets on its consumers.

use utopia_nats::jetstream::config::ExternalStream;
Rust
pub struct ExternalStream

A stream in another account or domain.

use utopia_nats::jetstream::config::Placement;
Rust
pub struct Placement

Where a stream's replicas are placed.

use utopia_nats::jetstream::config::Republish;
Rust
pub struct Republish

Republishes stored messages to another subject.

use utopia_nats::jetstream::config::StreamConfig;
Rust
pub struct StreamConfig

A stream's configuration. Durations are in seconds (the API's nanoseconds on the wire).

Rust
use utopia_nats::jetstream::{StorageType, StreamConfig};

let config = StreamConfig { subjects: vec!["orders.>".into()], storage: StorageType::Memory, max_age: Some(86400.0), ..StreamConfig::new("ORDERS") };
let wire = config.to_value();
assert_eq!(wire["max_age"], 86_400_000_000_000i64);
assert_eq!(StreamConfig::from_value(&wire), config);
use utopia_nats::jetstream::config::StreamSource;
Rust
pub struct StreamSource

A stream a mirror copies, or one of the streams a stream sources.

use utopia_nats::jetstream::config::SubjectTransform;
Rust
pub struct SubjectTransform

Rewrites subjects as messages are stored.

use utopia_nats::jetstream::config::nanos_to_seconds;
Rust
pub fn nanos_to_seconds(nanos: i64) -> f64

The API's nanoseconds to seconds.

use utopia_nats::jetstream::config::seconds_to_nanos;
Rust
pub fn seconds_to_nanos(seconds: f64) -> i64

Seconds to the nanoseconds the API takes, truncated.