| Crates.io | ultralytics-template-rust |
| lib.rs | ultralytics-template-rust |
| version | 0.0.5 |
| created_at | 2025-11-27 08:42:30.388431+00 |
| updated_at | 2025-11-27 11:37:02.270658+00 |
| description | Ultralytics Rust project template showcasing a minimal library and binary layout. |
| homepage | https://www.ultralytics.com/ |
| repository | https://github.com/ultralytics/template-rust |
| max_upload_size | |
| id | 1953318 |
| size | 87,914 |
Welcome to the Ultralytics Rust Project Template! This repository provides a standardized foundation for initiating Rust projects at Ultralytics. It incorporates best practices in project structure, configuration, and essential tooling to streamline development. By using this template, Ultralytics developers can ensure consistency, maintain high quality standards, and accelerate the setup process for new Rust-based software.
This template is organized for intuitive navigation and a clear understanding of Rust project components.
src/lib.rs: Core library code for the crate.src/main.rs: Example binary entrypoint that exercises the library.tests/: Integration tests executed with cargo test.docs/: Optional Markdown docs that complement Rustdoc output.Cargo.toml: Package metadata, dependencies, and workspace configuration..gitignore: Git ignore rules tailored for Cargo builds and IDEs.LICENSE: Project license file (default AGPL-3.0-or-later)..github/workflows/: GitHub Actions for CI, formatting, and publishing the crate.your-project/
โ
โโโ src/ # Library and binaries
โ โโโ lib.rs
โ โโโ main.rs
โโโ tests/ # Integration tests
โ โโโ basic.rs
โโโ docs/ # Additional Markdown docs (optional)
โ โโโ README.md
โโโ .github/workflows/ # CI, formatting, publish pipelines
โ โโโ ci.yml
โ โโโ format.yml
โ โโโ publish.yml
โโโ .gitignore # Git ignore rules for Rust
โโโ Cargo.toml # Cargo package metadata
โโโ LICENSE # Project license file
โโโ README.md # This file
src/)The src/ directory contains both the reusable library (lib.rs) and an example binary (main.rs). Expand the library
with modules as the crate grows, and keep binaries thin wrappers that delegate to library functions.
tests/)Integration tests in tests/ validate user-facing behavior. Add unit tests alongside the code they cover in src/ and
run everything with cargo test.
docs/)Keep Markdown guides in docs/ for onboarding and architecture notes. Rustdoc generated from src/ remains the source
of truth for API documentation (cargo doc --open).
Kickstart your new Rust project using this template:
Cargo.toml (package name, description, authors), refresh this README.md, and tailor
.github/workflows/*.yml as needed.src/lib.rs, binaries to src/bin/ or src/main.rs, and integration tests to tests/.cargo fmt, cargo clippy --all-targets --all-features -- -D warnings, and cargo test locally./// comments and expand docs/ for guides or ADRs.Install Rust via rustup and then:
cargo fmt
cargo test
cargo run
Using the published crate from another project (after release):
# Cargo.toml
[dependencies]
ultralytics-template-rust = "0.0.1"
use ultralytics_template_rust::add_numbers;
fn main() {
let sum = add_numbers(1, 2);
println!("Sum: {sum}");
}
main pushes when a new v<version> tag is needed; manual runs support dry_run: true.ultralytics-template-rust; tags follow v<version> from Cargo.toml.CARGO_REGISTRY_TOKEN (crates.io), GITHUB_TOKEN (built-in), and OPENAI_API_KEY for AI release notes.For Ultralytics team members and external contributors:
README.md and Cargo.toml aligned with the crateโs purpose and public API.With this template, Ultralytics aims to foster a culture of excellence and uniformity in Rust software development, ensuring every project starts on a solid foundation aligned with industry standards and organizational best practices.
Ultralytics thrives on community collaboration, and we deeply value your contributions! Whether it's reporting bugs, suggesting features, or submitting code changes, your involvement is crucial.
A heartfelt thank you ๐ goes out to all our contributors! Your efforts help make Ultralytics tools better for everyone.
Ultralytics offers two licensing options to accommodate diverse needs:
For bug reports or feature suggestions related to this template or other Ultralytics projects, please use GitHub Issues. For general questions, discussions, and community support, join our Discord server!