Struct CommandExecution
pub struct CommandExecution {
execution_id: Box<str>,
payload: Bytes,
payload_format: Option<PayloadFormat>,
}Expand description
A command execution request.
Fields§
§execution_id: Box<str>§payload: Bytes§payload_format: Option<PayloadFormat>Implementations§
§impl CommandExecution
impl CommandExecution
pub const fn execution_id(&self) -> &str
pub const fn execution_id(&self) -> &str
Returns the execution id of the command.
pub fn into_execution_id(self) -> Box<str>
pub fn into_execution_id(self) -> Box<str>
Consumes the command execution and returns its execution id.
pub fn deserialize_payload<T>(&self) -> Result<T>where
T: DeserializeOwned,
pub fn deserialize_payload<T>(&self) -> Result<T>where
T: DeserializeOwned,
Deserializes the payload of the command execution into the given type.
If the command payload is not one of the known formats (JSON or CBOR),
an Error::UnknownPayloadFormat is returned.
Use payload to get the raw payload.
pub const fn payload_format(&self) -> Option<PayloadFormat>
pub const fn payload_format(&self) -> Option<PayloadFormat>
Returns the payload format of the command execution, if known.
pub const fn payload(&self) -> &Bytes
pub const fn payload(&self) -> &Bytes
Returns the raw payload of the command execution.
See also deserialize_payload.
pub fn into_payload(self) -> Bytes
pub fn into_payload(self) -> Bytes
Consumes the command execution and returns its raw payload.
Auto Trait Implementations§
impl !Freeze for CommandExecution
impl RefUnwindSafe for CommandExecution
impl Send for CommandExecution
impl Sync for CommandExecution
impl Unpin for CommandExecution
impl UnwindSafe for CommandExecution
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