Cargo Features

[dependencies]
ockam_core = { version = "0.122.0", default-features = false, features = ["std", "no_std", "alloc", "error-traces", "debugger", "backtrace"] }
default = error-traces, std

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

std default = alloc, miette, opentelemetry, regex, serde_json, tracing-error, tracing-opentelemetry, tracing-subscriber

Feature (enabled by default): "std" enables functionality expected to be available on a standard platform.

Enables std and std_rng of rand, std of serde_bare, strum, and tinyvec, std of hex, minicbor, ockam_macros, and once_cell

Affects compat::rand.random_string, compat::sync, compat::time, ockam_core::env, local_message::LocalMessage.tracing_context

no_std = core2, hex, rand_pcg, spin, utcnow

Feature: "no_std" enables functionality required for platforms without the standard library.

Enables no_std of ockam_macros

alloc std

Feature: "alloc" enables support for heap allocation (implied by feature = "std")

Enables alloc of core2, hex, minicbor, serde, and serde_bare

Affects cbor::cbor_encode_preallocate, compat::println

error-traces default = once_cell, tracing-error

Feature: "error-traces" cover whether our errors capture backtraces and/or spantraces by default.
"backtrace" is disabled by default since it slows down the code drastically

debugger

Feature: "debugger" enables functionality to trace addresses and message flows within Ockam apps.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

backtrace implicit feature

Enables backtrace

backtrace:

A library to acquire a stack trace (backtrace) at runtime in a Rust program

core2 alloc? no_std?
hex alloc? no_std? std
miette std
once_cell error-traces std
opentelemetry std

Enables opentelemetry ^0.26.0

rand_pcg no_std?
regex std
serde_json std
spin no_std?
tracing-error error-traces std
tracing-opentelemetry std

Enables tracing-opentelemetry ^0.27.0

tracing-subscriber std
utcnow no_std?

Enables utcnow

Wasn't tested on no_std