pub struct UniqueOpts {
pub by_queue: bool,
pub by_args: bool,
pub by_period: Option<i64>,
pub states: u8,
}Expand description
Uniqueness constraint options.
Fields§
§by_queue: boolInclude queue in uniqueness calculation.
by_args: boolInclude args in uniqueness calculation.
by_period: Option<i64>Period bucket for time-based uniqueness (epoch seconds / period).
states: u8States in which uniqueness is enforced. Default: scheduled, available, running, completed, retryable (bits 0-4).
Implementations§
Source§impl UniqueOpts
impl UniqueOpts
Sourcepub fn states_bits(&self) -> Vec<u8> ⓘ
pub fn states_bits(&self) -> Vec<u8> ⓘ
Convert the states bitmask to a BIT(8) representation for Postgres.
Trait Implementations§
Source§impl Clone for UniqueOpts
impl Clone for UniqueOpts
Source§fn clone(&self) -> UniqueOpts
fn clone(&self) -> UniqueOpts
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UniqueOpts
impl Debug for UniqueOpts
Auto Trait Implementations§
impl Freeze for UniqueOpts
impl RefUnwindSafe for UniqueOpts
impl Send for UniqueOpts
impl Sync for UniqueOpts
impl Unpin for UniqueOpts
impl UnsafeUnpin for UniqueOpts
impl UnwindSafe for UniqueOpts
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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