Struct paho_mqtt::server_response::ServerResponse
source · [−]pub struct ServerResponse { /* private fields */ }
Expand description
Responses coming back from the server from client requests.
Implementations
sourceimpl ServerResponse
impl ServerResponse
sourcepub unsafe fn from_success(
req: ServerRequest,
rsp: &MQTTAsync_successData
) -> Self
pub unsafe fn from_success(
req: ServerRequest,
rsp: &MQTTAsync_successData
) -> Self
Creates the response object from the v3 “success” data structure sent by the C lib on completion of the operation.
Safety
This function runs in the context of a C callback indicating a
successful action. It directly accesses the pointers and unions
in the C MQTTAsync_successData
struct.
sourcepub unsafe fn from_success5(
req: ServerRequest,
rsp: &MQTTAsync_successData5
) -> Self
pub unsafe fn from_success5(
req: ServerRequest,
rsp: &MQTTAsync_successData5
) -> Self
Creates the response object from the v5 “success” data structure sent by the C lib on completion of the operation.
Safety
This function runs in the context of a C callback indicating a
successful v5 action. It directly accesses the pointers and unions
in the C MQTTAsync_successData5
struct.
sourcepub unsafe fn from_failure5(rsp: &MQTTAsync_failureData5) -> Self
pub unsafe fn from_failure5(rsp: &MQTTAsync_failureData5) -> Self
Creates the response object from the v5 “failure” data structure sent by the C lib on completion of the operation.
Safety
This function runs in the context of a C callback indicating a
failed v5 action. It directly accesses the pointers and unions
in the C MQTTAsync_failureData5
struct.
sourcepub fn request_response(&self) -> &RequestResponse
pub fn request_response(&self) -> &RequestResponse
Gets the response for the specific type of request.
sourcepub fn connect_response(&self) -> Option<ConnectResponse>
pub fn connect_response(&self) -> Option<ConnectResponse>
Gets the response for a connection request
sourcepub fn subscribe_response(&self) -> Option<i32>
pub fn subscribe_response(&self) -> Option<i32>
Gets the response for a subscription request.
sourcepub fn subscribe_many_response(&self) -> Option<Vec<i32>>
pub fn subscribe_many_response(&self) -> Option<Vec<i32>>
Gets the response for a multi-topic subscription request.
sourcepub fn unsubscribe_response(&self) -> Option<i32>
pub fn unsubscribe_response(&self) -> Option<i32>
Gets the response for an unsubscribe request.
sourcepub fn unsubscribe_many_response(&self) -> Option<Vec<i32>>
pub fn unsubscribe_many_response(&self) -> Option<Vec<i32>>
Gets the response for a multi-topic unsubscribe request.
sourcepub fn properties(&self) -> &Properties
pub fn properties(&self) -> &Properties
Gets the properties returned from the server.
sourcepub fn reason_code(&self) -> ReasonCode
pub fn reason_code(&self) -> ReasonCode
Gets the reason code returned from the server.
Trait Implementations
sourceimpl Clone for ServerResponse
impl Clone for ServerResponse
sourcefn clone(&self) -> ServerResponse
fn clone(&self) -> ServerResponse
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ServerResponse
impl Debug for ServerResponse
sourceimpl Default for ServerResponse
impl Default for ServerResponse
sourcefn default() -> ServerResponse
fn default() -> ServerResponse
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for ServerResponse
impl Send for ServerResponse
impl !Sync for ServerResponse
impl Unpin for ServerResponse
impl UnwindSafe for ServerResponse
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more