config
ModuleStream and consumer configuration, as the JetStream API reads and writes it.
Contents
Structs
ConsumerConfigA consumer's configuration. Durations are in seconds.ConsumerLimitsLimits a stream sets on its consumers.ExternalStreamA stream in another account or domain.PlacementWhere a stream's replicas are placed.RepublishRepublishes stored messages to another subject.StreamConfigA stream's configuration. Durations are in seconds (the API's nanoseconds on the wire).StreamSourceA stream a mirror copies, or one of the streams a stream sources.SubjectTransformRewrites subjects as messages are stored.use utopia_nats::jetstream::config::ConsumerConfig;Rust
pub struct ConsumerConfigA consumer's configuration. Durations are in seconds.
use utopia_nats::jetstream::config::ConsumerLimits;Rust
pub struct ConsumerLimitsLimits a stream sets on its consumers.
use utopia_nats::jetstream::config::ExternalStream;Rust
pub struct ExternalStreamA stream in another account or domain.
use utopia_nats::jetstream::config::Placement;Rust
pub struct PlacementWhere a stream's replicas are placed.
use utopia_nats::jetstream::config::Republish;Rust
pub struct RepublishRepublishes stored messages to another subject.
use utopia_nats::jetstream::config::StreamConfig;Rust
pub struct StreamConfigA 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 StreamSourceA stream a mirror copies, or one of the streams a stream sources.
use utopia_nats::jetstream::config::SubjectTransform;Rust
pub struct SubjectTransformRewrites subjects as messages are stored.
use utopia_nats::jetstream::config::nanos_to_seconds;Rust
pub fn nanos_to_seconds(nanos: i64) -> f64The API's nanoseconds to seconds.
use utopia_nats::jetstream::config::seconds_to_nanos;Rust
pub fn seconds_to_nanos(seconds: f64) -> i64Seconds to the nanoseconds the API takes, truncated.