pub struct CommandRequest {
pub command_name: String,
pub command_id: String,
pub idempotency_key: Option<String>,
pub payload: String,
}Expand description
Version 1 command request transported to the Runtime host.
Fields§
§command_name: StringDeclared application or Runtime command capability.
command_id: StringCaller-assigned request identity.
idempotency_key: Option<String>Replay-safe identity required by mutating commands.
payload: StringOpaque UTF-8 application payload.
Implementations§
Source§impl CommandRequest
impl CommandRequest
Sourcepub fn validate(
&self,
max_payload_bytes: usize,
) -> Result<(), CommandRequestValidationError>
pub fn validate( &self, max_payload_bytes: usize, ) -> Result<(), CommandRequestValidationError>
Validates identifiers, idempotency and the payload bound.
Sourcepub fn payload_bytes(&self) -> &[u8] ⓘ
pub fn payload_bytes(&self) -> &[u8] ⓘ
Borrows the UTF-8 payload as bytes.
Sourcepub fn to_envelope(
&self,
app_id: AppId,
node_id: NodeId,
issued_at_ms: u64,
max_payload_bytes: usize,
) -> RuntimeResult<CommandEnvelope>
pub fn to_envelope( &self, app_id: AppId, node_id: NodeId, issued_at_ms: u64, max_payload_bytes: usize, ) -> RuntimeResult<CommandEnvelope>
Validates and converts this request to the core command envelope.
Trait Implementations§
Source§impl Clone for CommandRequest
impl Clone for CommandRequest
Source§fn clone(&self) -> CommandRequest
fn clone(&self) -> CommandRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandRequest
impl Debug for CommandRequest
Source§impl<'de> Deserialize<'de> for CommandRequest
impl<'de> Deserialize<'de> for CommandRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CommandRequest
Source§impl PartialEq for CommandRequest
impl PartialEq for CommandRequest
Source§impl Serialize for CommandRequest
impl Serialize for CommandRequest
impl StructuralPartialEq for CommandRequest
Auto Trait Implementations§
impl Freeze for CommandRequest
impl RefUnwindSafe for CommandRequest
impl Send for CommandRequest
impl Sync for CommandRequest
impl Unpin for CommandRequest
impl UnsafeUnpin for CommandRequest
impl UnwindSafe for CommandRequest
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
Mutably borrows from an owned value. Read more