Nalix.Environment API Reference

Read time 1 minute Package: Nalix.Environment
On this page

Nalix.Environment provides the Level 1 memory, binary IO, configuration, time, cryptographic randomness, packet fragmentation, and sequence counter primitives used across the Nalix ecosystem.

Memory & Binary IO (Nalix.Environment.Memory)

  • Buffer Management — IBufferLease, BufferLease, BufferPoolManager, and BufferOptions.
  • BufferLease — Reference-counted pooled memory slice with headroom and cryptographic zeroing (ZeroOnDispose).
  • DataReader — Zero-allocation ref struct binary reader over ReadOnlySpan<byte>, ReadOnlyMemory<byte>, byte[], and byte*.
  • DataWriter — Zero-allocation ref struct binary writer supporting pooled auto-expanding and fixed-span modes.

Configuration (Nalix.Environment.Configuration)

Platform, Time, Random & Sequencing

  • Directories — Environment- and container-aware application directory resolution (Directories) with Unix permission hardening.
  • Clock — High-resolution monotonic and UTC Unix timestamp utilities (Clock).
  • Timing Scope — Zero-allocation readonly struct (TimingScope) for measuring elapsed ticks, microseconds, and milliseconds.
  • Random (Csprng) — Cryptographically strong random number generator backed by OS entropy (OsCsprng).
  • Sequencing (SequenceCounter) — Thread-safe monotonic sequence counter and sliding-window replay validator (Nalix.Environment.Sequencing).
  • Fragmentation (FragmentAssembler & FragmentHeader) — Splitting and reassembling oversized payloads (Nalix.Environment.Fragments and FragmentOptions).