#[non_exhaustive]pub struct EnqueueOpts {
pub delay: Duration,
pub max_attempts: u32,
pub dedup_id: Option<String>,
pub job_id: Option<JobId>,
pub trace_context: Option<TraceContext>,
pub priority: Priority,
pub concurrency_key: Option<String>,
}Expand description
Options for Queue::enqueue.
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.delay: DurationSQS DelaySeconds: the job is invisible until now + delay.
max_attempts: u32SQS redrive maxReceiveCount: deliveries before dead-lettering.
dedup_id: Option<String>SQS MessageDeduplicationId: dedups enqueues per (queue, dedup_id)
within the dedup window. None disables dedup.
job_id: Option<JobId>Caller-selected id for systems layered on top of queue, such as schedule.
Normal app enqueues leave this unset and let the backend mint an id. Backends
must treat a repeated same-queue id as idempotent success, including when a
fresh dedup_id is also supplied.
trace_context: Option<TraceContext>Reserved W3C propagation metadata. It is stored separately from the payload and baggage has already passed an explicit allow-list.
priority: PriorityBounded priority. Strict priority is used; sustained higher priority can starve lower.
concurrency_key: Option<String>Optional application key used with DequeueOpts::concurrency_limit_per_key.
Implementations§
Source§impl EnqueueOpts
impl EnqueueOpts
pub fn new() -> Self
Sourcepub fn with_delay(self, delay: Duration) -> Self
pub fn with_delay(self, delay: Duration) -> Self
Set the initial visibility delay.
Sourcepub fn with_max_attempts(self, max_attempts: u32) -> Self
pub fn with_max_attempts(self, max_attempts: u32) -> Self
Set the maximum delivery attempts before dead-lettering.
Sourcepub fn with_dedup_id(self, dedup_id: impl Into<String>) -> Self
pub fn with_dedup_id(self, dedup_id: impl Into<String>) -> Self
Set a deduplication id.
Sourcepub fn with_job_id(self, job_id: JobId) -> Self
pub fn with_job_id(self, job_id: JobId) -> Self
Set the job id the backend should assign. Intended for Forge primitives that need stable correlation across retries; callers usually let queue mint ids.
pub fn with_trace_context(self, trace_context: TraceContext) -> Self
pub fn with_priority(self, priority: Priority) -> Self
pub fn with_concurrency_key(self, key: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for EnqueueOpts
impl Clone for EnqueueOpts
Source§impl Debug for EnqueueOpts
impl Debug for EnqueueOpts
Auto Trait Implementations§
impl Freeze for EnqueueOpts
impl RefUnwindSafe for EnqueueOpts
impl Send for EnqueueOpts
impl Sync for EnqueueOpts
impl Unpin for EnqueueOpts
impl UnsafeUnpin for EnqueueOpts
impl UnwindSafe for EnqueueOpts
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,
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