Cargo Features
[dependencies]
rust_decimal = { version = "1.36.0", default-features = false, features = ["borsh", "c-repr", "db-diesel-mysql", "db-diesel-postgres", "db-diesel2-mysql", "db-diesel2-postgres", "db-postgres", "db-tokio-postgres", "legacy-ops", "maths", "maths-nopanic", "ndarray", "rand", "rkyv", "rkyv-safe", "rocket-traits", "rust-fuzz", "serde", "serde-arbitrary-precision", "proptest", "serde-bincode", "std", "serde-float", "serde-str", "serde-with-arbitrary-precision", "serde-with-float", "serde-with-str", "tokio-pg", "tokio-postgres"] }
- default = serde, std
-
These default features are set whenever
rust_decimal
is added without
somewhere in the dependency tree.default-features = false - borsh = std
-
Enables borsh
- c-repr
-
Force Decimal to be repr(C)
- db-diesel-mysql db-diesel2-mysql? = std
- db-diesel-postgres db-diesel2-postgres? = std
- db-diesel2-mysql = db-diesel-mysql
- db-diesel2-postgres = db-diesel-postgres
- db-postgres = std
-
Enables bytes and postgres-types
- db-tokio-postgres tokio-pg? = std
-
Enables bytes and postgres-types
- legacy-ops
- maths maths-nopanic?
- maths-nopanic = maths
- ndarray
-
Enables ndarray ^0.15.6
- rand
-
Enables rand
- rkyv rkyv-safe?
-
Enables rkyv ^0.7.42
- rkyv-safe
-
Enables validation of rkyv ^0.7.42
- rocket-traits
-
Enables rocket
- rust-fuzz
-
Enables arbitrary
- serde default serde-with-arbitrary-precision? serde-with-float? serde-with-str?
-
Enables serde
Affects
rust_decimal::serde
… - serde-arbitrary-precision = serde-with-arbitrary-precision
- proptest
-
Enables proptest
- serde-bincode = serde-str
-
Backwards compatability
- std default borsh? db-diesel-mysql? db-diesel-postgres? db-postgres? db-tokio-postgres?
-
Enables optional rkyv ^0.7.42, std of optional serde and optional serde_json and std of arrayvec, optional borsh, optional bytes, and optional rand
rand:
Option (enabled by default): without "std" rand uses libcore; this option enables functionality expected to be available on a standard platform.
- serde-float = serde-with-float
- serde-str serde-bincode? = serde-with-str
- serde-with-arbitrary-precision serde-arbitrary-precision? = serde
-
Enables arbitrary_precision and std of serde_json
Affects
serde::arbitrary_precision
,serde::arbitrary_precision_option
,serde::DecimalFromString
,rust_decimal::serde
… - serde-with-float serde-float? = serde
-
Affects
serde::float
,serde::float_option
,rust_decimal::serde
… - serde-with-str serde-str? = serde
-
Affects
serde::str
,serde::str_option
,rust_decimal::serde
… - tokio-pg = db-tokio-postgres
-
Backwards compatability
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.
- diesel db-diesel-mysql? db-diesel-postgres?
- serde_json serde-with-arbitrary-precision?
- tokio-postgres implicit feature
-
Enables tokio-postgres
tokio-postgres:
A native, asynchronous PostgreSQL client