#[repr(C)]
pub struct esp_mqtt_error_codes { pub esp_tls_last_esp_err: esp_err_t, pub esp_tls_stack_err: c_int, pub esp_tls_cert_verify_flags: c_int, pub error_type: esp_mqtt_error_type_t, pub connect_return_code: esp_mqtt_connect_return_code_t, pub esp_transport_sock_errno: c_int, }
Expand description

@brief MQTT error code structure to be passed as a contextual information into ERROR event

Important: This structure extends esp_tls_last_error error structure and is backward compatible with it (so might be down-casted and treated as esp_tls_last_error error, but recommended to update applications if used this way previously)

Use this structure directly checking error_type first and then appropriate error code depending on the source of the error:

| error_type | related member variables | note | | MQTT_ERROR_TYPE_TCP_TRANSPORT | esp_tls_last_esp_err, esp_tls_stack_err, esp_tls_cert_verify_flags, sock_errno | Error reported from tcp_transport/esp-tls | | MQTT_ERROR_TYPE_CONNECTION_REFUSED | connect_return_code | Internal error reported from MQTT broker on connection |

Fields

esp_tls_last_esp_err: esp_err_t

< last esp_err code reported from esp-tls component

esp_tls_stack_err: c_int

< tls specific error code reported from underlying tls stack

esp_tls_cert_verify_flags: c_int

< tls flags reported from underlying tls stack during certificate verification

error_type: esp_mqtt_error_type_t

< error type referring to the source of the error

connect_return_code: esp_mqtt_connect_return_code_t

< connection refused error code reported from MQTT broker on connection

esp_transport_sock_errno: c_int

< errno from the underlying socket

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.