pub struct Command {
pub command_id: String,
pub tenant_id: String,
pub domain: String,
pub aggregate_type: String,
pub aggregate_id: String,
pub command_type: String,
pub payload: Vec<u8>,
pub client_sig: Option<Signature>,
pub context: Option<RequestContext>,
pub vault_refs: Vec<String>,
pub deliver_at: i64,
pub deliver_until: i64,
}Expand description
A request to change one aggregate. Signed by the client over kernable.v1.command; the kernel queues it and hands it to a worker that registered its aggregate and command type.
Fields§
§command_id: StringChosen by the client (the SDKs use a random UUID). The kernel runs a command ID once: submitting it again returns the stored result, or waits for it.
tenant_id: String§domain: Stringof the aggregate and the command type
aggregate_type: Stringunqualified: Order
aggregate_id: Stringchosen by the client
command_type: Stringunqualified: PlaceOrder
payload: Vec<u8>§client_sig: Option<Signature>Over kernable.v1.command, by a key granted submit for domain.command_type.
context: Option<RequestContext>signed with the command, stored with its events
vault_refs: Vec<String>References to the values the payload keeps in the vault (see VaultValue), in payload order.
deliver_at: i64Signed, and only when set: a scheduled command, delivered at this time (ms since epoch) and
not before. Submit answers accepted at once; until then the command waits beside its
aggregate’s queue, so the aggregate’s other commands pass. Middlewares check it when it is
submitted and again when it is due. At most the kernel’s --schedule-max-days ahead.
deliver_until: i64Signed, and only when set: a scheduled command that cannot run by this time (ms since epoch),
after an outage say, is rejected expired instead of running late.
Trait Implementations§
Source§impl Message for Command
impl Message for Command
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 Command
Auto Trait Implementations§
impl Forget for Command
impl Freeze for Commandwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Attribute>: Freeze,
PhantomData<String>: Freeze,
impl Move for Command
impl RefUnwindSafe for Command
impl Send for Commandwhere
RawVecInner: Send,
impl Sync for Commandwhere
RawVecInner: Sync,
impl Unpin for Command
impl UnsafeUnpin for Commandwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Commandwhere
RawVecInner: UnwindSafe,
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