#[non_exhaustive]pub struct PostgresOutboxSettings {
pub statement_timeout: Duration,
}Expand description
What is provider-specific about the outbox. Everything portable lives in
reliar_outbox::OutboxSettings.
Built from Self::default plus builder methods, never a struct literal (#[non_exhaustive]
so a new field never breaks a caller outside this crate):
use reliar_store_postgres::PostgresOutboxSettings;
use std::time::Duration;
let settings = PostgresOutboxSettings::default().statement_timeout(Duration::from_secs(2));
assert_eq!(settings.statement_timeout, Duration::from_secs(2));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.statement_timeout: DurationApplied as SET LOCAL statement_timeout inside the short transaction Reliar opens for
every statement it issues on its own pool — acquire, complete, fail, release,
extend_lease, stats, purge (each of its three statements), list_dead,
retry_dead, purge_dead — never the caller’s enqueue transaction, which is the
caller’s own to bound. Duration::ZERO (the default) issues nothing and inherits the
server/role setting; a non-zero value costs a BEGIN/SET LOCAL/statement(s)/COMMIT
round trip on every call. STATEMENT_TIMEOUT_MS.
Implementations§
Source§impl PostgresOutboxSettings
impl PostgresOutboxSettings
Sourcepub const fn statement_timeout(self, timeout: Duration) -> Self
pub const fn statement_timeout(self, timeout: Duration) -> Self
Sets Self::statement_timeout.
use reliar_store_postgres::PostgresOutboxSettings;
use std::time::Duration;
let settings = PostgresOutboxSettings::default()
.statement_timeout(Duration::from_millis(500));
assert_eq!(settings.statement_timeout, Duration::from_millis(500));Sourcepub fn from_env(prefix: &str) -> Result<Self, SettingsError>
pub fn from_env(prefix: &str) -> Result<Self, SettingsError>
Opt-in. Starts from Self::default, overrides only the variables present under
prefix, and returns Err for a present-but-unparseable or out-of-range value — never
a silent fallback to the default.
use reliar_store_postgres::PostgresOutboxSettings;
use std::time::Duration;
// SAFETY: doctests run single-threaded per binary; no other code reads this var.
unsafe { std::env::set_var("EXAMPLE_OUTBOX_STATEMENT_TIMEOUT_MS", "500") };
let settings = PostgresOutboxSettings::from_env("EXAMPLE_OUTBOX_")?;
assert_eq!(settings.statement_timeout, Duration::from_millis(500));§Errors
Returns SettingsError::Parse for a present variable that cannot be parsed as its
declared type.
Trait Implementations§
Source§impl Clone for PostgresOutboxSettings
impl Clone for PostgresOutboxSettings
Source§fn clone(&self) -> PostgresOutboxSettings
fn clone(&self) -> PostgresOutboxSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PostgresOutboxSettings
impl Debug for PostgresOutboxSettings
Source§impl Default for PostgresOutboxSettings
impl Default for PostgresOutboxSettings
Source§impl<'de> Deserialize<'de> for PostgresOutboxSettingswhere
PostgresOutboxSettings: Default,
Available on crate feature serde only.
impl<'de> Deserialize<'de> for PostgresOutboxSettingswhere
PostgresOutboxSettings: Default,
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PostgresOutboxSettings
impl RefUnwindSafe for PostgresOutboxSettings
impl Send for PostgresOutboxSettings
impl Sync for PostgresOutboxSettings
impl Unpin for PostgresOutboxSettings
impl UnsafeUnpin for PostgresOutboxSettings
impl UnwindSafe for PostgresOutboxSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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