Cargo Features
[dependencies]
gitoid = { version = "0.7.1", default-features = false, features = ["async", "hex", "serde", "sha1", "sha1cd", "sha256", "std", "url"] }
- default = async, hex, serde, sha1, sha1cd, sha256, std, url
-
By default, you get:
- Hashes: sha1, sha1cd, sha256.
- Async: ability to asynchronously produce GitOIDs using the Tokio runtime.
- Hex: ability to print a GitOid with a hexadecimal hash representation.
- Url: ability to convert a GitOid to and from a gitoid-scheme URL.
- Serde: ability to serialize and deserialize a GitOid to and from a URL. - async default = std
-
Async support is optional. That said, it's currently only with Tokio, meaning you'd need to handle integrating with any other async runtime yourself. In the future it may be nice to make our async support fully generic and not specific to a given runtime.
Note also that async support implies using the standard library, as Tokio is not
no_std
-compatible.Enables tokio
Need "rt" and "fs" additionally for tests.
- hex default url = std
-
Get the ability to print the contents of the hash buffer as a hexadecimal string.
This relies on
std
as we don't currently expose ano_std
-compatible variant of our API's which usehex
.Enables hex
- serde default = std, url
-
Get the ability to serialize and deserialize
GitOids
.Enables serde
- sha1 default
-
All hash algorithms are optional, though you need to have at least one algorithm turned on for this crate to be useful. This is intended to just let you avoid paying the cost of algorithms you don't use.
Enables sha1
Affects
hash_algorithm::Sha1
… - sha1cd default
-
Enables sha1collisiondetection
Affects
hash_algorithm::Sha1Cd
… - sha256 default
-
Enables sha2
Affects
hash_algorithm::Sha256
… - std default async hex serde url
-
Get standard library support.
This feature is enabled by default. You can disable it to run in environments without
std
, usually embedded environments.Enables std of optional sha1, optional sha1collisiondetection, and optional sha2 and format-bytes
std-requiring dependencies.
no_std compatible dependencies.
NOTE: Must match the version used in the hash crate.
Technically, we could rely on the re-export from one of those crates,
but since all the hash crates are optional dependencies our usage code within the 'gitoid' crate would be more complex to handle the possibility for any/all of them to be missing. It's simpler to just specify it here so we know we always get the crate. - url default serde = hex, std
-
Get the ability to construct and get out URLs.
This relies on
std
as theurl
crate isn'tno_std
-compatible. This also relies onhex
as the URL includes the hex-encoded hash.Enables url