Narra

Reference

Standard library

Standard library

Every public module of the standard library. A module page lists its types, functions and constants with their signatures and effects, and links to the guide chapter that teaches the module.

These pages are generated by scripts/std/generate.nra from narrac query --json interface. Do not edit them.

Modules

  • std/arena: Values in slots, reached through handles that check the generation of the slot.
  • std/args: A command line as data: flags, positionals and subcommands, parsed in one call.
  • std/array: Arrays: length, push, slices and loops over values and entries.
  • std/async: Task handles of async functions: wait for all, the first, or cancel.
  • std/atomic: Atomic<T>, a bool or an integer with atomic operations.
  • std/box: Box<T>, a value behind a reference, for recursive data.
  • std/build: The target a program is built for: operating system, architecture and build mode.
  • std/bytes: Byte strings: conversion from and to arrays and text, slices and concatenation.
  • std/cell: Cell<T>, one mutable slot that every copy of the handle shares.
  • std/channel: Bounded channels between threads.
  • std/char: Characters, their code points and ASCII classes.
  • std/coroutine: Resume a generator by hand and send values into it.
  • std/cstring: CString, a string with no zero byte, which C reads as a zero-terminated string.
  • std/env: The command line arguments and the environment variables of the process.
  • std/f32: 32-bit floats: conversion, truncation and text.
  • std/fixedarray: Helpers over FixedArray, an array whose length is part of its type.
  • std/float: 64-bit floats: conversion, square root, truncation, text (reading and printing) and PI.
  • std/fs: Files and folders: read, write, list, create and remove.
  • std/hash: Hashes of Hashable values and the FNV-1a hash of text.
  • std/i16: 16-bit signed integers: checked arithmetic, conversion and text.
  • std/i32: 32-bit signed integers: checked arithmetic, conversion and text.
  • std/i8: 8-bit signed integers: checked arithmetic, conversion and text.
  • std/int: int, the 64-bit signed integer: checked arithmetic, division, parsing and text.
  • std/io: Standard input, output and error.
  • std/iterator: Lazy and eager operations over generators.
  • std/json: Parse and write JSON text as a Value of std/shape, or as any Shape type.
  • std/map: Maps: size, keys, entries, update and remove.
  • std/math: Number functions: minimum and maximum, powers, roots, rounding and trigonometry.
  • std/net: TCP sockets on the event loop of the thread.
  • std/option: Helpers over Option, the type of a value that may be missing.
  • std/parallel: Run a function over an array on several threads.
  • std/path: File paths as text: join, folder, base name and extension.
  • std/process: Run other programs and exit the process.
  • std/ptr: Ptr<T>, a raw pointer for unsafe code and C.
  • std/random: A seeded random number generator that gives the same numbers on every platform.
  • std/range: Ranges of integers for for ... of loops.
  • std/regex: Regular expressions with a linear-time engine.
  • std/result: Helpers over Result, the type of a value or an error.
  • std/set: Set<T>, a collection of distinct values with union, intersection and difference.
  • std/shape: Value, a dynamic tree for structured data, and the Shape trait.
  • std/shared: Shared<T>, a value guarded by a lock.
  • std/simd: Vector types and operations on all their lanes at once.
  • std/string: Text: length, slices, search, trim, pad, split and join, and a builder.
  • std/template: The parts type and the tag of tagged templates.
  • std/terminal: Detect a terminal and style text for it.
  • std/test: Assertions for test blocks: equality, panics and golden files.
  • std/thread: Threads that run in a scope.
  • std/time: A monotonic clock for measuring, the wall clock, and an async sleep.
  • std/toml: Parse and write TOML text as a Value of std/shape.
  • std/u16: 16-bit unsigned integers: checked arithmetic, conversion and text.
  • std/u32: 32-bit unsigned integers: checked arithmetic, conversion and text.
  • std/u64: 64-bit unsigned integers: checked arithmetic, conversion and text.
  • std/u8: 8-bit unsigned integers: checked arithmetic, conversion and text.
  • std/unicode: Grapheme clusters, case mapping and display width.