Rustic.Common
0.4.1
See the version list below for details.
dotnet add package Rustic.Common --version 0.4.1
NuGet\Install-Package Rustic.Common -Version 0.4.1
<PackageReference Include="Rustic.Common" Version="0.4.1" />
paket add Rustic.Common --version 0.4.1
#r "nuget: Rustic.Common, 0.4.1"
// Install Rustic.Common as a Cake Addin #addin nuget:?package=Rustic.Common&version=0.4.1 // Install Rustic.Common as a Cake Tool #tool nuget:?package=Rustic.Common&version=0.4.1
Rustic
Common
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 |
Memory
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. |
Vector
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
struct
s 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.
IO
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));
ArrayPool<byte>.Return(poolArray);
-- or --
var obj = [...]
PoolBufWriter<byte> writer = new();
Serializer.Serialize(writer, obj);
return writer.ToArray(dispose: true);
Text
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 | Versions 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. |
-
.NETCoreApp 3.1
- System.Memory (>= 4.5.4)
-
.NETStandard 2.1
- System.Memory (>= 4.5.4)
-
net5.0
- System.Memory (>= 4.5.4)
-
net6.0
- System.Memory (>= 4.5.4)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on Rustic.Common:
Package | Downloads |
---|---|
Rustic.Text
Types and extensions improving string access and formatting functionality. Formatter, SeqSplitIter, SplitIter, Tokenizer |
|
Rustic.Memory.Common
Packages types and functionality used for many `Rustic.Memory` projects. |
|
Rustic.Memory.Vec
Commonly used collection implementation allowing by-ref access to the storage. Vec, RefVec, PoolVec |
|
Rustic.Memory.Bit
Packed bit collections. Storing sequences of boolean values in integers. BitSet, BitVec |
|
Rustic.Memory.Buffers
IBufferWriter implementing IVector interface. BufWriter, RentArray |
GitHub repositories
This package is not used by any popular GitHub repositories.
# Version 0.4.1
- Validate null checks
- Use branchless Max
- Add test cases for BufWriterTests
# Version 0.4.0
- Rename project root.
- Enforce horizontal separation between projects.
- Create `BitVec`.
# Version 0.3.0
## 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.