pub struct Config {
pub url: String,
pub credentials: Option<String>,
pub max_messages: i64,
pub max_bytes: i64,
pub inbox_max_messages: i64,
pub inbox_max_bytes: i64,
}Expand description
Connection settings. Kept away from the bus’s own configuration: this is infrastructure an operator points at, never something a client supplies.
Fields§
§url: Stringe.g. nats://127.0.0.1:4222. TLS in production; the fixture runs
plaintext on a private port.
credentials: Option<String>Runtime credential: publish and fetch only. Provisioning uses a different one, which the server process does not hold.
max_messages: i64Per-team stream ceilings for the body stream. Quotas are an operator decision — the right number depends on the disk the broker actually has — so they are configuration with a documented default, not a constant.
max_bytes: i64§inbox_max_messages: i64The inbox stream’s own ceilings, independent of the body stream’s.
inbox_max_bytes: i64Implementations§
Source§impl Config
impl Config
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
Production defaults: bounded, file-backed, refusing new writes when full rather than discarding history.
Sourcepub fn with_limits(self, max_messages: i64, max_bytes: i64) -> Self
pub fn with_limits(self, max_messages: i64, max_bytes: i64) -> Self
Smaller ceilings for both streams, for a fixture whose broker has a small store.
Sourcepub fn with_inbox_limits(self, max_messages: i64, max_bytes: i64) -> Self
pub fn with_inbox_limits(self, max_messages: i64, max_bytes: i64) -> Self
Ceilings for the inbox stream alone.
Sourcepub fn validate_quotas(&self) -> BusResult<()>
pub fn validate_quotas(&self) -> BusResult<()>
Refuse quotas that could never work before the broker is asked: a body stream must hold at least one maximum-size message, and a count of zero would refuse every write.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more