Unio.Types
0.7.12
Requires NuGet 2.12 or higher.
dotnet add package Unio.Types --version 0.7.12
NuGet\Install-Package Unio.Types -Version 0.7.12
<PackageReference Include="Unio.Types" Version="0.7.12" />
<PackageVersion Include="Unio.Types" Version="0.7.12" />
<PackageReference Include="Unio.Types" />
paket add Unio.Types --version 0.7.12
#r "nuget: Unio.Types, 0.7.12"
#:package Unio.Types@0.7.12
#addin nuget:?package=Unio.Types&version=0.7.12
#tool nuget:?package=Unio.Types&version=0.7.12
Unio.Types
Pre-built, high-performance sentinel and value types for use with Unio discriminated unions.
Usage
using Unio;
using Unio.Types;
// Use marker types in discriminated unions
Unio<User, NotFound> GetUser(int id) => ...;
Unio<Order, Forbidden, NotFound> GetOrder(int id) => ...;
Unio<Success, ValidationError> Validate(Request req) => ...;
// Use value-carrying types for rich results
Unio<Success<Order>, Error<string>> CreateOrder(OrderRequest req) => ...;
Unio<Created<int>, ValidationError<string[]>> SaveUser(UserDto dto) => ...;
Included Types
Markers (empty sentinel structs)
Yes, No, Maybe, True, False, Unknown, All, Some, None, Empty, Pending, Cancelled, Timeout, Skipped, Invalid, NotFound, Forbidden, Unauthorized, Conflict, BadRequest, Accepted, NoContent, Created, Updated, Deleted, Unchanged, Success, Error, Disabled, Expired, RateLimited
Value Carriers (structs with Value property)
Success<T>, Error<T>, Result<T>, NotFound<T>, Created<T>, Updated<T>, ValidationError (string Message), ValidationError<T>
All types are readonly struct with IEquatable<T>, ==/!= operators and AggressiveInlining on hot paths.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Unio.Types:
| Package | Downloads |
|---|---|
|
Unio.AspNetCore
Unio provides high-performance, struct-based discriminated unions for C#. Zero-allocation, exhaustive matching, Match, Switch and TryGet patterns and full value semantics. Simple, performant and scalable. |
GitHub repositories
This package is not used by any popular GitHub repositories.