Skip to content

API Reference

Felix Jones edited this page Jan 15, 2026 · 1 revision

API Reference

Complete API documentation for muesli.

Codec Implementations

Core codec types for serializing different data types

Fundamental Types

Strings

Containers

  • array_codec — Codec for fixed-size arrays.
  • element_codec — Value type is a fixed-size array of element values
  • next_codec — Returns the next codec in the encoding chain
  • encode — Encodes an array as a range
  • decode — Decodes a range back into a fixed-size array
  • array_of — Helper function to create an array_codec with deduced element type
  • range_codec — Codec for range-based iteration over encoded sequences.
  • vector_codec — Codec for encoding/decoding std::vector containers
  • vector_of — Helper function to create a vector_codec

Composite Types

Value Wrappers

Transformations

  • constant_codec — Codec for constant values with compile-time enforcement.
  • constrained_codec — Codec for constrained values with validation predicates.
  • move — The value type from the inner codec
  • optional — Implementation of constrained_codec::optional() method
  • delimiter_predicate — Element value type from the element codec
  • decode_state — Internal state for decoding delimited ranges
  • identity_codec — The simplest codec - passes values through unchanged

Utility Codecs

Fluent API Mixins

Trait-based mixins that extend codecs with method chains

Core Mixins

Format Handlers

Serialization format implementations

Binary Format

  • StreamPush — Concept for streams that support push operations for move-only types
  • StreamPeekPop — Concept for streams that support peek and pop operations for move-only types
  • OutputStream — Concept for output streams that can write values of type T
  • InputStream — Concept for input streams that can read values of type T
  • binary_format — Binary serialisation format for encoding/decoding codec values
  • serialize — Serialises multiple values from an input stream to a byte output stream
  • deserialize — Deserialises multiple values from a byte input stream to an output stream
  • make_binary_format — Deduction guide for binary_format.

Utilities

Type traits, concepts, and helper utilities

Type Traits

Concepts

Ranges

  • move_only_generator — Move-only generator function wrapper
  • m_callable — Default-constructs an empty generator that throws if invoked until assigned
  • operator — Deleted copy constructor to preserve move-only semantics
  • range_holder — Holder for ranges that can be either owned or generated on-the-fly
  • iterator — Iterator for range_holder supporting both span and generator modes
  • m_span_it — Default constructor
  • m_cached_value — Constructs a generator-backed iterator; optionally as end sentinel
  • m_data — Deleted copy constructor to enforce move-only semantics
  • end — Wraps a contiguous range by referencing its span (caller must keep it alive)
  • begin — Iterator to the first element (throws if holder is invalid)

Clone this wiki locally