Rustic.Common 0.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rustic.Common --version 0.4.0                
NuGet\Install-Package Rustic.Common -Version 0.4.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rustic.Common" Version="0.4.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rustic.Common --version 0.4.0                
#r "nuget: Rustic.Common, 0.4.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rustic.Common as a Cake Addin
#addin nuget:?package=Rustic.Common&version=0.4.0

// Install Rustic.Common as a Cake Tool
#tool nuget:?package=Rustic.Common&version=0.4.0                



dotnet add package Rustic.Common

Namespace Rustic.Common

Definition Description
ref struct StrBuilder ValueStringBuilder from ValueStringBuilder: a stack-based string-builder.
static class ThrowHelper Centralized functionality related to validation and throwing exceptions.
static class Arithmetic Collection of extension methods and utility functions related to integer arithmetic. Most functions are ported from bithacks


dotnet add package Rustic.Memory

Namespace Rustic.Memory

Definition Description
struct TinyVec Read-only list with a inline capacity of 4. Also see TinySpan
readonly ref struct TinySpan Partially inlined immutable collection of function parameters.
readonly ref struct BitSet Enables unaligned marking of bits in a memory area.
readonly ref struct BitVec Partially inlined immutable collection of function parameters.


Namespace Rustic.Memory.Vector

This package mainly contains the list and buffer implementations

Definition Description
class Vec System.Collections.Generic.List-like implementation allowing by-ref access.
ref struct RefVec Temporary array allocating from ArrayPool<T>.Default.

that aim to optimize memory management, by

  • returning structs by-ref or -readonly ref on access,
  • optimizing for temporary array usage by providing implementations allowing allocation from a ArrayPool<T>,
  • and inlining tiny arrays.


Namespace Rustic.Memory.IO

For constructing or writing sequences of data an array is often required. Therefore, a List<T> has to be copied to the required layout, to circumvent this BufWriter allows moving the reference of the internal array to user control safely.

Definition Description
class BufWriter IBufferWriter similar to Vec.
class PoolBufWriter IBufferWriter similar to PoolVec.

var obj = [...]
PoolBufWriter<byte> writer = new();
Serializer.Serialize(writer, obj);
DoWork(writer.ToSpan(out byte[] poolArray));

-- or --

var obj = [...]
PoolBufWriter<byte> writer = new();
Serializer.Serialize(writer, obj);
return writer.ToArray(dispose: true);


dotnet add package Rustic.Text

Namespace Rustic.Text

In addition to that the package provides the following non-allocating helpers for parsing text and more

Definition Description
ref struct SplitIter Iterator slicing a sequence of elements into smaller sequences, by a set of separators. Analogous in function to string.Split
ref struct Tokenizer Allows scanning and navigating a sequence of elements on a per-iteration basis. Inspired by Utf8JsonReader but much more generic.
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on Rustic.Common:

Package Downloads

Types and extensions improving string access and formatting functionality. Formatter, SeqSplitIter, SplitIter, Tokenizer


Packages types and functionality used for many `Rustic.Memory` projects.


Commonly used collection implementation allowing by-ref access to the storage. Vec, RefVec, PoolVec


Packed bit collections. Storing sequences of boolean values in integers. BitSet, BitVec


IBufferWriter implementing IVector interface. BufWriter, RentArray

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.6.4 729 7/5/2023
0.6.3 700 5/18/2023
0.6.2 685 5/18/2023
0.6.1 1,381 1/27/2023
0.6.0 1,098 1/27/2023
0.5.80 4,856 2/15/2022
0.5.0 4,387 2/11/2022
0.4.1 928 1/28/2022
0.4.0 930 1/28/2022

# Version 0.40

- Rename project root.
- Enforce horizontal separation between projects.
- Create `BitVec`.

# Version 0.30

## Major fixes
- Fixed bogus `ArrayPool` usage
- Fix `SplitIter` includes separator. Is not optional
- Change project structure and naming. Notably: `ValueList` → `RefVec`, `RefList` → `Vec`, `ParamSpan` → `TinySpan` and others.

## Minor fixes
- Remove bogus extension-method overloads.
- More & better documentation