pub struct SubmitTask {
pub tenant_id: String,
pub namespace: String,
pub queue: String,
pub program: ProgramRef,
pub correlation_key: Option<String>,
pub data: Value,
pub retry_policy: RetryPolicy,
pub attempt_timeout_ms: u64,
}Expand description
A request to create one logical task, before assigning run or attempt IDs.
data may be any JSON value, with at most 64 nested arrays/objects and a
compact serialized size of 1 MiB. Strings, including escaped U+0000, remain
application-owned. Integer tokens must fit i64/u64; fractional/exponent
tokens use finite binary64, as in the worker protocol.
Tenant, namespace, and queue must contain 1–128 UTF-8 bytes and no Unicode
control characters or Unicode noncharacters, matching the platform identifier
rules. Optional correlation contains at most 512 UTF-8 bytes and no control
characters. Program identifiers use ProgramRef::validate.
The default retry policy is supplied by RetryPolicy::default; omitted
attempt timeout is 300,000 ms and must be between 60,000 and 86,400,000 ms.
Unknown submission fields are rejected.
Use Self::semantically_matches rather than ordinary JSON equality for
idempotency: integer and floating values, and positive/negative floating
zero, have intentionally different normalized representations.
Fields§
§tenant_id: String§namespace: String§queue: String§program: ProgramRef§correlation_key: Option<String>§data: Value§retry_policy: RetryPolicy§attempt_timeout_ms: u64Implementations§
Source§impl SubmitTask
impl SubmitTask
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate a constructed submission, including bounded JSON encoding.
This cannot detect duplicate keys or preexisting numeric rounding in a
Value; incoming transport bytes must pass through Self::decode.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self>
pub fn decode(bytes: &[u8]) -> Result<Self>
Decode a complete JSON request without duplicate-key collapse or out-of-range integer rounding, then validate its fields and limits.
Duplicate keys are rejected at every depth, including inside user data; keys with equivalent JSON escape spellings are also duplicates. Trailing bytes, invalid UTF-8, nonfinite numbers, and unknown fields are rejected.
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>>
pub fn canonical_bytes(&self) -> Result<Vec<u8>>
Return a deterministic JSON encoding for semantic request comparison.
Object keys are sorted recursively. Array order and string values remain
significant. Missing defaults normalize to their explicit values, and a
missing or null correlation key normalizes to absence. Integer 1 and
float 1.0 differ; equivalent binary64 spellings such as 1e0 and 1.0
match. Positive and negative floating zero differ. The existing parser
treats the spelling -0 as floating negative zero, matching -0.0.
This is Ledgence’s comparison encoding, not an implementation of RFC 8785 or arbitrary-precision numeric canonicalization.
Sourcepub fn semantically_matches(&self, other: &Self) -> Result<bool>
pub fn semantically_matches(&self, other: &Self) -> Result<bool>
Compare validated submissions using Self::canonical_bytes.
Every field in this type participates, including scope, correlation, immutable program identity, and the normalized execution policy.