API Reference

58 modules · 148 public declarations

Async

pub fn AsyncBox()
/// // box still owned here

BTreeMap

pub fn BTreeMap()
/// A simple binary search tree map (not self-balancing).

Mutex

pub fn Mutex()
/// mutex.unlock();
pub fn MutexGuard()
/// RAII guard for Mutex.
pub fn RwLock()
///
pub fn RwLockReadGuard()
/// RAII guard for RwLock read access.
pub fn RwLockWriteGuard()
/// RAII guard for RwLock write access.

Semaphore

pub const Semaphore
///

LazyStatic

pub fn LazyStatic()
/// var GLOBAL_CONFIG = LazyStatic(Config).init(initConfig);
pub fn LazyStaticAlloc()
/// A variant that uses an external allocator for heap-allocated types.

HashMap

pub fn HashMap()
/// A hash map that owns `Box(T)` values keyed by strings.

Channel

pub fn Channel()
pub fn Oneshot()
pub fn bounded()
pub fn unbounded()

Slice

pub fn Slice()
/// - `[N]T` (stack arrays) → no borrow needed

CheckedInt

pub const OverflowError
pub fn CheckedInt()
pub fn SaturatingInt()

ManuallyDrop

pub fn Type()
/// Pattern: Similar to Rust's `std::mem::ManuallyDrop`.

OffsetGuard

pub fn OffsetPtr()
/// A pointer with bounds information, preventing out-of-bounds access.
pub fn GuardedSlice()
/// A slice with bounds tracking.

LockFreeQueue

pub fn LockFreeQueue()
/// atomic CAS on head and tail pointers.

SimdUtils

pub fn findByte()
pub fn eql()
pub fn startsWith()
pub fn endsWith()
pub fn copy()
pub fn fill()
pub fn findAnyByte()
pub fn countByte()
pub fn findByteReverse()
/// Find the last occurrence of a byte in a haystack, scanning backwards with SIMD.
pub fn findByteSet()
/// Find the first occurrence of any byte from a set (like `strcspn`).
pub fn eqlIgnoreCase()
/// Case-insensitive equality for ASCII strings using SIMD.
pub fn startsWithIgnoreCase()
/// Case-insensitive `startsWith` for ASCII strings.
pub fn contains()
/// Substring search using Boyer-Moore-Horspool with SIMD-accelerated verification.
pub fn countSubstring()
/// Count non-overlapping occurrences of a substring.
pub fn trimLeft()
/// Remove leading bytes that are present in `chars`.
pub fn trimRight()
/// Remove trailing bytes that are present in `chars`.

RwLock2

pub fn RwLockUpgrade()
/// - `1..READ_MASK` = number of active readers
pub fn RwLockUpgradeReadGuard()
/// RAII read guard for RwLockUpgrade.
pub fn RwLockUpgradeWriteGuard()
/// RAII write guard for RwLockUpgrade.
pub fn ReentrantMutex()
/// A mutex that allows the same thread to lock it multiple times (recursive locking).
pub fn ReentrantMutexGuard()
/// RAII guard for ReentrantMutex.

Iterators

pub fn MapIter()
///
pub fn FilterIter()
///
pub fn EnumerateIter()
/// Enumerate values with their zero-based index.
pub fn TakeIter()
/// Take only the first `n` values from an iterator.
pub fn SkipIter()
/// Skip the first `n` values from an iterator.
pub fn ChainIter()
/// Chain two iterators of the same item type together.
pub fn fold()
///
pub fn collectArrayList()
/// Collect all remaining items into a `std.ArrayList(T)`.
pub fn count()
/// Count the remaining items in an iterator.
pub fn any()
/// Check if any remaining item satisfies the predicate.
pub fn find()
/// Find the first item matching the predicate.
pub fn position()
/// Find the zero-based index of the first matching item.
pub fn all()
/// Check if all remaining items satisfy the predicate.
pub fn sum()
/// Sum all remaining items.
pub fn min()
/// Find the minimum item according to the given `lessThan` function.
pub fn max()
/// Find the maximum item according to the given `lessThan` function.
pub fn ZipIter()
/// Zip two iterators together, yielding pairs of items.
pub fn ClonedIter()
/// Clone values from an iterator that yields `*const T`.
pub fn SliceIter()
/// Consuming iterator over `Slice(T)` elements.
pub fn ArrayListIter()
/// Consuming iterator over `ArrayList(T)` elements.
pub fn VecDequeIter()
/// Consuming iterator over `VecDeque(T)` elements.
pub const StringIter
/// Consuming iterator over `String` bytes.

Lifetime

pub const ScopeId
/// Unique identifier for a lexical scope.
pub fn currentScope()
/// Get the current global scope counter value.
pub fn enterScope()
/// Enter a new scope. Returns the new scope ID.
pub fn StackRef()
/// Safe to use ONLY within the same lexical scope where it was created,
pub fn ScopeGuard()
/// var ref = StackRef(u32).init(scope, &x);
pub fn NonNull()
///

SmallString

pub fn SmallString()
/// Only allocates on the heap for larger strings.
pub const SmallString23
/// Type alias: SmallString with 23-byte inline capacity (common SSO size)
pub const SmallString15
/// Type alias: SmallString with 15-byte inline capacity

LockHierarchy

pub fn OrderedMutex()
/// circular deadlocks at compile/run time.
pub fn OrderedMutexGuard()
/// RAII guard for OrderedMutex. Automatically removes the order from the
pub fn NonReentrantMutex()
/// A mutex that panics (returns error) if the same thread tries to lock it
pub fn NonReentrantMutexGuard()
/// RAII guard for NonReentrantMutex. Clears the owner field on drop so

String

pub const String
/// A growable UTF-8 string that owns its buffer.

ThreadPool

pub const ThreadPool
/// Spawns a fixed number of worker threads that process tasks

Arc

pub fn Arc()
/// const maybe_arc = weak.upgrade(); // returns null
pub fn Weak()
/// Weak reference to an Arc.

CString

pub const CString
/// A safe C-style string (null-terminated) with length tracking.

StringInterner

pub const InternedString
/// Interned string handle. Just a pointer to the shared string data.
pub const StringInterner
/// String interner: deduplicates strings for fast comparison.

MaybeUninit

pub fn Type()
/// Pattern: Similar to Rust's `std::mem::MaybeUninit`.

VecDeque

pub fn VecDeque()
///

RingBuffer

pub fn RingBuffer()
/// try rb.write(&[_]u8{1, 2, 3});

LinkedList

pub fn LinkedList()
/// A singly-linked list where each node's `next` pointer is an owned Box.

Pool

pub fn Pool()
///
pub fn PoolBox()
/// A reference to a pooled object. Automatically returns to pool on deinit.
pub fn FixedVec()
/// A growable vector with a maximum capacity.

Allocator

pub const ZustAllocator
/// Wraps any `std.mem.Allocator` and provides zust-friendly allocation methods.
pub fn wrap()
/// Wrap an existing allocator into a ZustAllocator.
pub const TrackingAllocator
///

Box

pub fn BoxStateful()
/// `mut_count`: number of active mutable borrows (0 or 1)
pub fn Box()
/// Convenience alias for an owned Box(T, 0, 0, 0).

ArrayList

pub fn ArrayList()
/// A growable array that owns `Box(T)` values.

HashSet

pub const HashSet
/// A hash set of u64 values.

TimedLock

pub const TimedMutex
///
pub const TimedMutexGuard
/// RAII guard for TimedMutex.

SendSync

pub fn isSend()
///
pub fn isSync()
pub fn assertSend()
/// Assert that T is Send at compile time
pub fn assertSync()
/// Assert that T is Sync at compile time
pub fn SendBox()
/// Thread-safe wrapper: only allows Send types
pub fn SyncBox()
/// Thread-safe wrapper: only allows Sync types

Cow

pub fn Cow()
///

Scope

pub fn ScopeImm()
/// const dead = box.deinit(); // OK!
pub fn ScopeMut()
/// Mutable borrow scope. Releases when deinitialized.

BTreeSet

pub const BTreeSet
/// A set of unique u64 keys backed by a binary search tree.

Duration

pub const Duration
/// Safe duration type with checked arithmetic.
pub const Instant
/// A monotonic instant for measuring elapsed time.

PathBuf

pub const PathBuf
/// A safe filesystem path buffer.

BloomFilter

pub fn BloomFilter()

TaggedUnion

pub fn TaggedUnion2()
/// try std.testing.expectEqual(u.asA().*, 42);
pub fn TaggedUnion3()
/// A 3-variant tagged union with runtime tag checking.
pub fn Result()
/// A Result type (like Rust's Result).
pub fn Option()
/// An Option type (like Rust's Option).

Default

pub fn Default()
/// - vectors → all lanes set to Default of child type

Arena

pub fn Arena()
/// Arena allocator that tracks allocation scope.
pub fn ArenaBox()
/// A pointer to arena-allocated memory.

Resources

pub fn FileGuard()
/// RAII guard for std.Io.File.
pub fn DirGuard()
/// RAII guard for std.Io.Dir.
pub fn MappedFileGuard()
/// RAII guard for memory-mapped files.
pub fn ArenaGuard()
/// RAII guard for a memory allocator reset.

Rc

pub fn Rc()
/// Similar to Rust's `Rc` — cheaper than `Arc` when thread-safety is not needed.

Barrier

pub const Barrier
/// Blocks until all N threads call `wait()`, then all proceed.

Stack

pub fn Stack()
/// A LIFO stack with ownership transfer.
pub fn Queue()
/// A FIFO queue with ownership transfer.

OnceCell

pub fn OnceCell()
/// Similar to Rust's `std::sync::OnceCell` or `once_cell::unsync::OnceCell`.
pub fn LazyCell()
/// Lazy initialization cell with inline storage.
pub fn OnceBox()
/// Heap-allocated one-time initialization cell.

BinaryHeap

pub fn BinaryHeap()
/// The caller provides a `compare` function that returns true when the first

DeadlockDetector

pub const DeadlockDetector
/// and detects cycles in the wait-for graph.

Condvar

pub fn Condvar()
/// A condition variable for thread synchronization.

UnsafeCell

pub fn UnsafeCell()
/// Interior mutability for non-Copy types.

PhantomData

pub fn PhantomData()
/// Zero-sized marker type that carries type information.

AtomicCounter

pub fn AtomicCounter()
/// Generic atomic counter.

Aligned

pub fn AlignedPtr()
/// A pointer type that enforces alignment at compile time.
pub fn CacheAligned()
/// Wraps a value with cache-line padding to prevent false sharing between threads.

Pin

pub fn Pin()
/// Wraps a heap-allocated `Box(T)` and guarantees the pointee

BitSet

pub fn FixedBitSet()
pub const BitSet

Cell

pub fn Cell()
///
pub fn RefCell()
/// Tracks outstanding borrows at runtime.
pub fn Ref()
/// Immutable borrow guard for RefCell.
pub fn RefMut()
/// Mutable borrow guard for RefCell.

58 modules · 149 declarations