Struct aws_sdk_iotdataplane::client::fluent_builders::Publish
source · pub struct Publish { /* private fields */ }
Expand description
Fluent builder constructing a request to Publish
.
Publishes an MQTT message.
Requires permission to access the Publish action.
For more information about MQTT messages, see MQTT Protocol in the IoT Developer Guide.
For more information about messaging costs, see Amazon Web Services IoT Core pricing - Messaging.
Implementations§
source§impl Publish
impl Publish
sourcepub async fn customize(
self
) -> Result<CustomizableOperation<Publish, AwsResponseRetryClassifier>, SdkError<PublishError>>
pub async fn customize(
self
) -> Result<CustomizableOperation<Publish, AwsResponseRetryClassifier>, SdkError<PublishError>>
Consume this builder, creating a customizable operation that can be modified before being sent. The operation’s inner http::Request can be modified as well.
sourcepub async fn send(self) -> Result<PublishOutput, SdkError<PublishError>>
pub async fn send(self) -> Result<PublishOutput, SdkError<PublishError>>
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn retain(self, input: bool) -> Self
pub fn retain(self, input: bool) -> Self
A Boolean value that determines whether to set the RETAIN flag when the message is published.
Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.
Valid values: true
| false
Default value: false
sourcepub fn set_retain(self, input: Option<bool>) -> Self
pub fn set_retain(self, input: Option<bool>) -> Self
A Boolean value that determines whether to set the RETAIN flag when the message is published.
Setting the RETAIN flag causes the message to be retained and sent to new subscribers to the topic.
Valid values: true
| false
Default value: false
sourcepub fn payload(self, input: Blob) -> Self
pub fn payload(self, input: Blob) -> Self
The message body. MQTT accepts text, binary, and empty (null) message payloads.
Publishing an empty (null) payload with retain = true
deletes the retained message identified by topic from Amazon Web Services IoT Core.
sourcepub fn set_payload(self, input: Option<Blob>) -> Self
pub fn set_payload(self, input: Option<Blob>) -> Self
The message body. MQTT accepts text, binary, and empty (null) message payloads.
Publishing an empty (null) payload with retain = true
deletes the retained message identified by topic from Amazon Web Services IoT Core.