#[non_exhaustive]pub struct SetResponse<T = Value> {
pub account_id: Id,
pub old_state: Option<State>,
pub new_state: State,
pub created: Option<HashMap<String, T>>,
pub updated: Option<HashMap<Id, Option<T>>>,
pub destroyed: Option<Vec<Id>>,
pub not_created: Option<HashMap<String, SetError>>,
pub not_updated: Option<HashMap<Id, SetError>>,
pub not_destroyed: Option<HashMap<Id, SetError>>,
pub extra: Map<String, Value>,
}Expand description
RFC 8620 §5.3 — Foo/set response shape.
Wire shape per RFC 8620 §5.3 (rfc8620.txt §5.3 around line 2033):
created Id[Foo] | null
updated Id[Foo|null] | null ← inner null is REQUIRED
destroyed Id[] | null
notCreated Id[SetError] | null
notUpdated Id[SetError] | null
notDestroyed Id[SetError] | nullThe inner null in updated is the server’s signal that the patch was
applied verbatim with no server-set property deltas to report; a typed
SetResponse<Foo> MUST accept this rather than failing because null
cannot become Foo.
created and not_created keys are caller-supplied creation ids
(String); updated, not_updated, not_destroyed keys are
server-assigned record ids (Id) — typed differently so callers can
use updated/destroyed keys interchangeably with ids from any
/get response.
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.account_id: IdThe account the response refers to.
old_state: Option<State>State token before this /set was applied. Optional because some
servers omit it on no-op responses (per RFC 8620 §5.3 the field is
nullable).
new_state: StateState token after this /set.
created: Option<HashMap<String, T>>Successfully created objects, keyed by caller-supplied creation id.
updated: Option<HashMap<Id, Option<T>>>Successfully updated objects, keyed by record id. The value is
Some(T) when the server reports server-set property deltas, or
None when the patch was applied verbatim with nothing to echo.
destroyed: Option<Vec<Id>>Ids of successfully destroyed objects.
not_created: Option<HashMap<String, SetError>>Failed creates, keyed by caller-supplied creation id.
not_updated: Option<HashMap<Id, SetError>>Failed updates, keyed by record id.
not_destroyed: Option<HashMap<Id, SetError>>Failed destroys, keyed by record id.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).
Trait Implementations§
Source§impl<T> Clone for SetResponse<T>where
T: Clone,
impl<T> Clone for SetResponse<T>where
T: Clone,
Source§fn clone(&self) -> SetResponse<T>
fn clone(&self) -> SetResponse<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more