pub struct CoapClientSession<'a> { /* private fields */ }
Expand description

Representation of a client-side CoAP session.

Implementations

Create a new DTLS encrypted session with the given peer.

To supply cryptographic information (like PSK hints or key data), you have to provide a struct implementing CoapClientCryptoProvider.

Errors

Will return a SessionCreationError if libcoap was unable to create a session (most likely because it was not possible to bind to a port).

Create a new unencrypted session with the given peer over UDP.

Errors

Will return a SessionCreationError if libcoap was unable to create a session (most likely because it was not possible to bind to a port).

Sets the provider for cryptographic information for this session.

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
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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 application specific data stored alongside this session.
Sets the application-specific data stored alongside this session.
Clears the application-specific data stored alongside this session.
Returns the Ack-Random-Factor used by libcoap. Read more
Sets the Ack-Random-Factor used by libcoap.
Returns the current value of the Acknowledgement Timeout for this session (in seconds). Read more
Sets the value of the Acknowledgement Timeout for this session.
Returns the local address for this session.
Returns the remote address for this session.
Returns the interface index for this session.
Returns the maximum number of retransmissions for this session.
Sets the maximum number of retransmissions for this session.
Returns the underlying transport protocol used for this session.
Returns the current PSK hint for this session.
Returns the current PSK identity for this session.
Returns the current PSK key for this session.
Returns the current state of this session.
Initializes the token value used by libcoap. Read more
Returns the maximum size of a PDU for this session.
Sets the maximum size of a PDU for this session.
Returns the next message ID that should be used for this session.
Returns the next token that should be used for requests.
Send a ping message to the remote peer.
Send the given message-like object to the peer. Read more
Sends the given CoapRequest, returning a CoapRequestHandle that can be used to poll the request for completion. Read more
Polls whether the request for the given handle already has pending responses. Read more
Returns whether this session waits for the provided token.
Stops listening for responses to this request handle. Read more
Returns a mutable reference to the underlying raw session. Read more
Returns a reference to the underlying raw session. 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.