Cargo Features

[dependencies]
libcoap-rs = { version = "0.2.2", default-features = false, features = ["dtls", "dtls_tinydtls", "dtls_openssl", "dtls_gnutls", "dtls_mbedtls", "tcp", "nightly", "vendored"] }
default = dtls, dtls_openssl, tcp

These default features are set whenever libcoap-rs is added without default-features = false somewhere in the dependency tree.

dtls default

Enables dtls of libcoap-sys

libcoap-sys:

While not specified here due to limitations in Cargo's syntax, the DTLS feature depends on one of the DTLS backends being enabled. If you are developing a library based on libcoap-sys and do not care about the DTLS backend, enable the dtls feature and let the user decide on the backend to use, either by re-exporting these features (see https://doc.rust-lang.org/cargo/reference/features.html#dependency-features) or by assuming that the user will use libcoap-sys as a dependency and enable the corresponding backend feature themselves, relying on Cargo's feature unification to enable it for your crate as well. Also note that the backends are mutually exclusive due to the C library having these backends as mutually exclusive features. If multiple backends are enabled (e.g. because multiple dependencies use libcoap-sys and use different backends), we select one based on the auto-detection order specified in https://github.com/obgm/libcoap/blob/develop/configure.ac#L494 (gnutls > openssl > mbedtls > tinydtls).

Affects crypto::CoapCryptoPskInfo, crypto::CoapCryptoPskIdentity, crypto::CoapCryptoPskData, crypto::CoapCryptoProviderResponse, crypto::CoapClientCryptoProvider, crypto::CoapServerCryptoProvider, libcoap-rs::crypto, session::CoapSessionCommon.psk_hint, session::CoapSessionCommon.psk_identity, session::CoapSessionCommon.psk_key

dtls_tinydtls

Enables dtls_backend_tinydtls of libcoap-sys

dtls_openssl default

Enables dtls_backend_openssl of libcoap-sys

dtls_gnutls

Enables dtls_backend_gnutls of libcoap-sys

dtls_mbedtls

Enables dtls_backend_mbedtls of libcoap-sys

tcp default

Affects tcp::CoapTcpEndpoint, tls::CoapTlsEndpoint

nightly
vendored

Enables vendored of libcoap-sys

libcoap-sys:

Enabling this feature will force libcoap-sys to be built with and statically linked to a vendored version of libcoap,
which will be built by the build-script before building libcoap-sys.
This way, it is no longer required to have libcoap installed to use this crate.