-
Notifications
You must be signed in to change notification settings - Fork 125
Description
Instruction File Name
rust.instructions.mde
Scope
File-level (applies to specific file type)
Purpose
Summary
Add comprehensive Rust coding conventions to the coding-standards/ collection, following the same structure and depth as the existing C# instructions (coding-standards/csharp/).
Motivation
Rust is used across multiple projects for edge AI services, WASM operators, telemetry pipelines, and IoT connectors. A shared set of conventions ensures consistency, reduces review friction, and gives Copilot the context it needs to generate idiomatic code. The C# instructions already demonstrate value here — Rust deserves the same treatment.
Proposed Files
| File | Location | Purpose |
|---|---|---|
rust.instructions.md |
.github/instructions/coding-standards/rust/ |
Core Rust conventions (naming, error handling, async, observability, serialization, testing, etc.) |
Requirements
Scope
The instructions cover:
- Project structure and crate layout conventions
- Cargo.toml standards (dependency management, release profiles, feature flags)
- Naming conventions table with type suffix patterns (
*Error,*Config,*Builder) - Error handling with
thiserror/anyhowsplit and customResulttype aliases - Async patterns (Tokio runtime selection, concurrency with
select!/try_join!,async-trait) - Observability via
tracingand optional OpenTelemetry integration - Serialization with Serde patterns and defaults
- Configuration management (environment variables, file-based config,
OnceLock) - Resilience patterns (retry with exponential backoff)
- Visibility rules and feature flag conventions
- Code documentation standards (
///,# Errors,# Examples) - Clippy and formatting requirements
- Testing conventions (module placement, BDD-style naming, async tests)
- Patterns to avoid checklist
- Complete example demonstrating all conventions in a single file
Out of Scope
Project-specific patterns (Azure IoT Operations SDKs, WASM operator macros, private registries) belong in downstream repo instructions that reference hve-core, not in the shared coding standard itself.
Acceptance Criteria
-
rust.instructions.mdexists at.github/instructions/coding-standards/rust/ - Frontmatter includes
applyTo: '**/*.rs'and attribution - Structure mirrors
coding-standards/csharp/csharp.instructions.md(sections, tables, XML-wrapped examples, complete example) - Content is general-purpose — no domain-specific SDK references
- Examples compile conceptually and demonstrate idiomatic Rust