feat(rust): add std, no_std and alloc features to getting started examples
@@ -5,11 +5,37 @@ authors = ["Ockam Developers"]
edition = "2018"
license = "Apache-2.0"
+[features]
+default = [
+ "std"
+]
+
+# Feature (enabled by default): "std" enables functionality expected to
+# be available on a standard platform.
+std = [
+ "ockam/default",
+ "ockam_transport_websocket",
+ "serde_json/default",
+]
+
+# Feature: "no_std" enables functionality required for platforms
+# without the standard library.
+no_std = [
+ "ockam/no_std",
+]
+
+# Feature: "alloc" enables support for heap allocation on "no_std"
+# platforms, requires nightly.
+alloc = [
+ "ockam/alloc",
+ "serde_json/alloc",
+]
+
[dependencies]
-ockam = { path = "../../../implementations/rust/ockam/ockam" }
-ockam_transport_websocket = { path = "../../../implementations/rust/ockam/ockam_transport_websocket" }
-serde = { version = "1", features = ["derive"] }
-serde_json = "1.0"
+ockam = { path = "../../../implementations/rust/ockam/ockam", default_features = false, features = ["software_vault"] }
+ockam_transport_websocket = { path = "../../../implementations/rust/ockam/ockam_transport_websocket", optional = true }
+serde = { version = "1", default_features = false, features = ["derive"] }
+serde_json = { version = "1.0", default_features = false }
[dev-dependencies]
rand = { version = "0.8.4", features = ["std_rng"] }
