Ferrous.Guard
2.2.0
See the version list below for details.
dotnet add package Ferrous.Guard --version 2.2.0
NuGet\Install-Package Ferrous.Guard -Version 2.2.0
<PackageReference Include="Ferrous.Guard" Version="2.2.0" />
<PackageVersion Include="Ferrous.Guard" Version="2.2.0" />
<PackageReference Include="Ferrous.Guard" />
paket add Ferrous.Guard --version 2.2.0
#r "nuget: Ferrous.Guard, 2.2.0"
#:package Ferrous.Guard@2.2.0
#addin nuget:?package=Ferrous.Guard&version=2.2.0
#tool nuget:?package=Ferrous.Guard&version=2.2.0
Ferrous.Guard
Zero-allocation, stack-allocated RAII scope guards (ref struct) for .NET—bringing Rust's Drop / defer pattern to C# without heap allocations or boxing.
Installation
dotnet add package Ferrous.Guard
Quick Example
using Ferrous.Guard;
// Zero-allocation state passing (no closure allocation)
using var guard = ScopeGuard.Defer(resource, static r => r.Release());
// Commit / rollback pattern
using var rollback = ScopeGuard.Defer(transaction, static tx => tx.Rollback());
transaction.Commit();
rollback.Dismiss();
See the Scope Guards Guide and Ferrous Repository for full documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Ferrous.Core (>= 2.2.0)
-
net11.0
- Ferrous.Core (>= 2.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Ferrous.Guard:
| Package | Downloads |
|---|---|
|
Ferrous
Rust-grade compile-time safety, zero-allocation primitives, source generators, and Clippy-style Roslyn analyzers for .NET (polyfilling on .NET 10 and lighting up natively on .NET 11 / C# 15). |
|
|
Ferrous.Testing
Rust-grade testing utilities for .NET: in-memory compile-fail assertions (CompileAssert, like Rust's trybuild), framework-agnostic Result/Option assertions, and zero-allocation assertions (AllocAssert). |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.0 | 0 | 11/30/2026 |
| 2.3.0 | 0 | 11/30/2026 |
| 2.2.0 | 0 | 11/30/2026 |
| 2.1.0 | 0 | 11/30/2026 |
| 2.0.0 | 0 | 11/30/2026 |
| 1.7.4 | 0 | 11/30/2026 |
| 1.7.3 | 0 | 11/30/2026 |
| 1.7.2 | 0 | 11/30/2026 |
| 1.7.1 | 0 | 11/30/2026 |
| 1.7.0 | 0 | 11/30/2026 |
| 1.6.0 | 0 | 11/30/2026 |
| 1.5.0 | 0 | 11/30/2026 |
| 1.4.0 | 30 | 11/30/2026 |
| 1.3.3 | 39 | 11/30/2026 |
| 1.3.2 | 39 | 11/30/2026 |
| 1.3.1 | 34 | 11/30/2026 |
| 1.3.0 | 39 | 11/30/2026 |
| 1.2.0 | 51 | 11/30/2026 |