Rust Implementation
[!NOTE] These libraries conform to UCAN v1.0.0-rc.1
[!WARNING] This code has not been formally audited. Use at your own risk!
Add the following to the [dependencies] section of your Cargo.toml file:
ucan = "0.8"Testing the Project
Section titled “Testing the Project”Run tests
| Nix | Cargo |
|---|---|
test:all | cargo test |
Benchmarking the Project
Section titled “Benchmarking the Project”For benchmarking and measuring performance, this project leverages
Criterion and a test_utils feature flag.
Benchmarks
Section titled “Benchmarks”| Nix | Cargo |
|---|---|
bench | cargo bench --features=test_utils |
Contributing
Section titled “Contributing”:balloon: We’re thankful for any feedback and help in improving our project! We have a contributing guide to help you get involved. We also adhere to our Code of Conduct.
This repository contains a Nix flake that initiates both the Rust
toolchain set in rust-toolchain.toml and a pre-commit hook. It also
installs helpful cargo binaries for development.
Please install Nix to get started. We also recommend installing direnv.
Run nix develop or direnv allow to load the devShell flake output,
according to your preference.
The Nix shell also includes several helpful shortcut commands.
You can see a complete list of commands via the menu command.
Formatting
Section titled “Formatting”For formatting Rust in particular, we automatically format on nightly, as it
uses specific nightly features we recommend by default.
Pre-commit Hook
Section titled “Pre-commit Hook”This project recommends using pre-commit for running pre-commit hooks. Please run this before every commit and/or push.
- If you are doing interim commits locally, and for some reason if you don’t
want pre-commit hooks to fire, you can run
git commit -a -m "Your message here" --no-verify.
Recommended Development Flow
Section titled “Recommended Development Flow”- We recommend leveraging [cargo-watch][cargo-watch],
cargo-expandand IRust for Rust development. - We recommend using [cargo-udeps][cargo-udeps] for removing unused dependencies before commits and pull-requests.
Conventional Commits
Section titled “Conventional Commits”This project lightly follows the Conventional Commits
convention to help explain
commit history and tie in with our release process. The full specification
can be found here. We recommend prefixing your commits with
a type of fix, feat, docs, ci, refactor, etc…, structured like so:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]Getting Help
Section titled “Getting Help”For usage questions, usecases, or issues reach out to us in the UCAN Discord.
We would be happy to try to answer your question or try opening a new issue on GitHub.
External Resources
Section titled “External Resources”These are references to specifications, talks and presentations, etc.
License
Section titled “License”This project is licensed under the Apache License 2.0, or http://www.apache.org/licenses/LICENSE-2.0.
