#[non_exhaustive]pub enum JobRejection {
Show 15 variants
UnknownQueue {
queue: String,
},
PayloadTooLarge {
limit: u64,
actual: u64,
},
EncodingNotAllowed {
encoding: String,
allowed: Vec<String>,
},
JobTypeNotAllowed {
job_type: String,
allowed: Vec<String>,
},
CustomEntriesTooMany {
limit: u32,
actual: u32,
},
CustomMapTooLarge {
limit: u64,
actual: u64,
},
CustomKeyTooLong {
key: String,
limit: u32,
actual: u64,
},
QueueNameTooLong {
limit: u32,
actual: u64,
},
JobTypeNameTooLong {
limit: u32,
actual: u64,
},
IdempotencyKeyTooLong {
limit: u32,
actual: u64,
},
ScheduledTooFar {
horizon: Duration,
actual: SystemTime,
},
InvalidRequest {
message: String,
},
QueueFull {
queue: String,
limit: u64,
},
QueueClosing {
queue: String,
},
Unknown,
}Expand description
Why the server refused a single job.
Every variant except QueueFull and
QueueClosing is deterministic: re-sending the
same job against the same server state produces the same rejection.
Transient problems (a storage outage, a dropped connection) are never
reported here — they surface as a ClientError
instead. Most limits behind these variants are advertised up front by
ServerInfo, so a producer can validate locally before sending.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownQueue
The server is in strict mode and the target queue has not been declared.
PayloadTooLarge
The payload exceeds the queue’s
max_payload_bytes.
EncodingNotAllowed
The queue restricts encodings and the payload’s encoding is not on the allow-list.
JobTypeNotAllowed
The queue restricts job types and this one is not on the allow-list.
CustomEntriesTooMany
The custom map has more entries than
max_custom_entries.
CustomMapTooLarge
The custom map’s total size exceeds
max_custom_total_bytes.
CustomKeyTooLong
A custom key exceeds
max_custom_key_bytes.
QueueNameTooLong
The queue name exceeds
max_queue_name_bytes.
JobTypeNameTooLong
The job type exceeds
max_job_type_bytes.
IdempotencyKeyTooLong
The idempotency key exceeds
max_idempotency_key_bytes.
ScheduledTooFar
scheduled_at is further out than
max_schedule_horizon.
InvalidRequest
The request failed the server’s structural validation (e.g. a required
field was missing); message carries the detail.
QueueFull
The target queue is at capacity (limit is its configured max depth).
Non-deterministic: it clears once the queue drains.
QueueClosing
The target queue is being deleted and is not accepting new jobs. Non-deterministic: it clears once the delete completes or is abandoned.
Unknown
The server sent a rejection reason this client version does not recognize.
Trait Implementations§
Source§impl Clone for JobRejection
impl Clone for JobRejection
Source§fn clone(&self) -> JobRejection
fn clone(&self) -> JobRejection
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 JobRejection
impl Debug for JobRejection
Source§impl Display for JobRejection
impl Display for JobRejection
Source§impl Error for JobRejection
impl Error for JobRejection
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for JobRejection
impl PartialEq for JobRejection
impl StructuralPartialEq for JobRejection
Auto Trait Implementations§
impl Freeze for JobRejection
impl RefUnwindSafe for JobRejection
impl Send for JobRejection
impl Sync for JobRejection
impl Unpin for JobRejection
impl UnsafeUnpin for JobRejection
impl UnwindSafe for JobRejection
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request