pub struct CoapResource<D: Any + ?Sized + Debug> { /* private fields */ }
Expand description

Representation of a CoapResource that can be requested from a server.

Implementations

Creates a new CoapResource for the given uri_path.

Handlers that are associated with this resource have to be able to take a reference to the provided user_data value as their first value.

The notify_con parameter specifies whether observe notifications originating from this resource are sent as confirmable or non-confirmable.

Notify any observers about changes to this resource.

Sets whether this resource can be observed by clients according to RFC 7641.

Sets whether observe notifications for this resource should be sent as confirmable or non-confirmable CoAP messages.

Returns the user data associated with this resource.

Mutably returns the user data associated with this resource.

Restores a resource from its raw coap_resource_t.

Safety

The supplied pointer must point to a valid coap_resource_t instance that has a Rc<RefCell<CoapResourceInner<D>>> as its user data.

Sets the handler function for a given method code.

Trait Implementations

Formats the value using the given formatter. 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 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.