pub struct BatchResult {
pub applied: bool,
pub results: Vec<BatchEntry>,
pub succeeded: usize,
pub errors_suppressed: usize,
pub failed: usize,
pub orphan_stubs_removed: Vec<EntityId>,
pub commit_sha: String,
}Expand description
Result of an atomic batch update — all-or-nothing.
A batch either applies in full as a single commit (applied: true)
or, if any item fails (validation, hash mismatch, missing entity),
applies nothing and refuses (applied: false) with the offending
item named. There is no partial-application middle state: a refused
batch leaves the on-disk mem and the in-memory store byte-identical
to the pre-call state.
Fields§
§applied: booltrue when every item applied (one commit); false when the
batch was refused (a single item failed → nothing committed).
results: Vec<BatchEntry>One entry per submitted item, in submission order. On an applied
batch every entry’s action is "updated" (a real write) or
"noop" (content unchanged). On a refused batch the failing
item’s action is "error" with a populated error envelope,
and every other item’s action is "not_applied".
succeeded: usizeCount of applied items when applied; 0 when refused.
errors_suppressed: usizeNumber of FAILING entries whose error envelopes were suppressed
beyond the reporting cap (bounded reporting for very large
failing batches — the entries still carry action: "error",
only the detailed envelope is omitted). 0 when every failure
is fully reported.
failed: usizeCount of failed items when refused (≥1); 0 when applied.
orphan_stubs_removed: Vec<EntityId>Ids of stub entities GC’d because a removed edge in this batch
was their last incoming reference — the batch sibling of the
single relate response’s orphan_stubs_removed. Empty (and
serde-omitted) for batch-create / batch-update and for batches
that removed nothing.
commit_sha: StringThe single batch commit SHA when the batch applied and produced
at least one write — an honest memstead_changes_since cursor /
revert handle for the whole batch. Empty when the batch was
refused, when it was empty, or when every item was a no-op (no
commit happens). For a batch spanning multiple mems this names
the last mem committed; single-mem batches (the common case)
name their one commit.
Trait Implementations§
Source§impl Clone for BatchResult
impl Clone for BatchResult
Source§fn clone(&self) -> BatchResult
fn clone(&self) -> BatchResult
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 BatchResult
impl Debug for BatchResult
Source§impl Serialize for BatchResult
impl Serialize for BatchResult
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for BatchResult
impl RefUnwindSafe for BatchResult
impl Send for BatchResult
impl Sync for BatchResult
impl Unpin for BatchResult
impl UnsafeUnpin for BatchResult
impl UnwindSafe for BatchResult
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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