pub struct Result {
pub lease_id: String,
pub events: Vec<NewEvent>,
pub worker_sig: Option<Signature>,
pub snapshot: Option<Snapshot>,
pub vault: Vec<VaultValue>,
pub keys: Vec<UniqueKey>,
pub facts: Vec<String>,
pub requires: Vec<Requirement>,
pub index_sig: Option<Signature>,
}Expand description
The events a command produced (possibly none). Signed by the worker over kernable.v1.result,
which covers the command and expected_version but not the lease. If another command changed
the aggregate meanwhile, the kernel runs the command again (Execute with the new history), a
few times before it rejects it with concurrency_conflict.
Fields§
§lease_id: String§events: Vec<NewEvent>§worker_sig: Option<Signature>by Register.key_id
snapshot: Option<Snapshot>Optional: the state after these events, at expected_version + len(events), signed over kernable.v1.snapshot by the same key. Only with at least one event; an invalid snapshot ends the stream like an invalid result signature. Not stored after an erasure.
vault: Vec<VaultValue>the values of the events’ vault_refs
keys: Vec<UniqueKey>The full set of unique keys and facts the aggregate holds after these events
(empty: none), and the facts other aggregates must hold for the command to commit. The
kernel checks them atomically with the commit: a key another aggregate holds rejects the
command with unique_taken, a missing fact with requirement_missing. At most 64 keys,
64 facts and 64 requirements; key and fact names are valid type names (no dots) of at most
128 bytes; no key twice (name, scope and value hash), no fact twice. Otherwise
invalid_index. A command that leaves its aggregate without events holds nothing. An
aggregate whose key another one holds (a duplicate from before the key was declared) is
rejected with unique_taken until its key changes or becomes null.
facts: Vec<String>§requires: Vec<Requirement>§index_sig: Option<Signature>Over kernable.v1.index by Register.key_id; required when keys, facts or requires are set.
Apart from worker_sig, which every event stores and kernable verify checks against the
events alone.
Trait Implementations§
Source§impl Message for Result
impl Message for Result
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.impl StructuralPartialEq for Result
Auto Trait Implementations§
impl Forget for Result
impl Freeze for Result
impl Move for Result
impl RefUnwindSafe for Result
impl Send for Result
impl Sync for Result
impl Unpin for Result
impl UnsafeUnpin for Result
impl UnwindSafe for Result
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> 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