Struct ExecutionResponseTopic
pub struct ExecutionResponseTopic<'a> {
executions: ExecutionsTopic<'a>,
execution_id: &'a str,
resolution: Option<bool>,
payload_format: PayloadFormat,
}Expand description
Represents the MQTT topic where command execution responses are published.
Can also include the “resolution” (accepted/rejected) as part of the topic.
See with_accepted and
with_rejected.
Fields§
§executions: ExecutionsTopic<'a>§execution_id: &'a str§resolution: Option<bool>§payload_format: PayloadFormatImplementations§
§impl<'a> ExecutionResponseTopic<'a>
impl<'a> ExecutionResponseTopic<'a>
pub const fn new(
prefix: &'a str,
device_type: DeviceType,
device_id: &'a str,
execution_id: &'a str,
payload_format: PayloadFormat,
) -> Self
pub const fn new( prefix: &'a str, device_type: DeviceType, device_id: &'a str, execution_id: &'a str, payload_format: PayloadFormat, ) -> Self
Creates a new execution response topic.
pub fn parse(topic: &'a str) -> Result<Self>
pub const fn payload_format(self) -> PayloadFormat
pub const fn payload_format(self) -> PayloadFormat
Returns the payload format segment of the topic.
pub const fn is_accepted(self) -> bool
pub const fn is_accepted(self) -> bool
Returns true if this topic is for accepted responses.
pub const fn with_accepted(self) -> ExecutionResponseTopic<'a>
pub const fn with_accepted(self) -> ExecutionResponseTopic<'a>
Returns the topic for accepted responses.
pub const fn is_rejected(self) -> bool
pub const fn is_rejected(self) -> bool
Returns true if this topic is for rejected responses.
pub const fn with_rejected(self) -> ExecutionResponseTopic<'a>
pub const fn with_rejected(self) -> ExecutionResponseTopic<'a>
Returns the topic for rejected responses.
Trait Implementations§
§impl<'a> Clone for ExecutionResponseTopic<'a>
impl<'a> Clone for ExecutionResponseTopic<'a>
§fn clone(&self) -> ExecutionResponseTopic<'a>
fn clone(&self) -> ExecutionResponseTopic<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl<'a> Display for ExecutionResponseTopic<'a>
impl<'a> Display for ExecutionResponseTopic<'a>
§impl<'a> PartialEq for ExecutionResponseTopic<'a>
impl<'a> PartialEq for ExecutionResponseTopic<'a>
impl<'a> Copy for ExecutionResponseTopic<'a>
impl<'a> Eq for ExecutionResponseTopic<'a>
impl<'a> StructuralPartialEq for ExecutionResponseTopic<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExecutionResponseTopic<'a>
impl<'a> RefUnwindSafe for ExecutionResponseTopic<'a>
impl<'a> Send for ExecutionResponseTopic<'a>
impl<'a> Sync for ExecutionResponseTopic<'a>
impl<'a> Unpin for ExecutionResponseTopic<'a>
impl<'a> UnwindSafe for ExecutionResponseTopic<'a>
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