moonmcap

    MoonBit-native MCAP message-log codec, indexed queries and file transformations

    mcap
    robotics
    binary
    logging
    index
    Download zip
    Version
    0.17.4
    License
    MIT
    Last updated
    5 days ago
    Downloads
    278

    #MoonMCAP

    MoonBit 的 MCAP 0 消息日志库,用于读取和校验机器人、传感器与仿真日志,按主题和时间查询,并裁剪、合并或恢复可读数据。当前版本 0.17.4。

    从 首次使用 开始,选择入口前阅读 支持范围。完整索引见 文档导航,异常处理见 排错说明。

    #安装

    项目固定编译基准为 moonc 0.10.17+d971670cd,满足不低于 0.10.16 的要求;另以当前官方工具链验证兼容性。本地文件和网络宿主需要 JS/Node.js 22.3+。

    在已有 MoonBit 项目中执行下面的安装命令;从空目录开始时,先创建 moon.mod:

    name = "example/use-mcap" version = "0.0.1"

    moon add LilaLola67/moonmcap@0.17.4

    使用方的 moon.pkg:

    import { "LilaLola67/moonmcap" @mcap, } pkgtype(kind:"executable")

    将下面保存为 main.mbt,执行 moon run . 或 moon run . --target js:

    ///|
    fn main {
    try {
    let recorder = @mcap.new_builder()
    let channel = recorder.register_channel("/events", "json")
    recorder.append(channel, 100UL, b"{\"value\":1}")
    let bytes = recorder.finish(compression=@mcap.Zstd)
    let messages = @mcap.query_file(bytes, {
    ..@mcap.all_query(), topics: ["/events"], start_time: 100UL, end_time: 100UL,
    }).messages
    assert_eq(messages.length(), 1)
    assert_eq(messages[0].data, b"{\"value\":1}")
    println("MCAP_SAMPLE_OK")
    } catch {
    @mcap.Invalid(reason) => abort(reason)
    error => abort("\{error}")
    }
    }

    预期输出 MCAP_SAMPLE_OK。库中的时间是 UInt64 纳秒,查询区间包含两端。 JSON 时间使用字符串保留精度;不根据设备字段名推断单位或时钟关系。

    #文件处理

    git clone https://github.com/LilaLola67/moonmcap.git cd moonmcap moon update moon build --target js node _build/js/debug/build/cmd/mcap/mcap.js query examples/files/zstd-summary.mcap --topic /imu --start 20000000000 --end 30000000000 --full

    应查询到 5 条消息,时间为 21、23、25、27、29 秒。完整的裁剪、校验和截断恢复命令及预期结果见 首次使用。示例文件随仓库提供,不需要实体设备。

    #能力与边界

    • 核心库(Wasm/JS):MCAP 0 标准记录、CRC、索引、无压缩/LZ4/Zstd、查询、变换与恢复。压缩字典、拼接帧和未声明的格式扩展不在支持范围,详见 格式兼容表。
    • 宿主与大文件路径(JS/Node):按需读取、磁盘索引、流式输出、外部排序、持久任务、HTTP 范围读取和可选工作线程。它们分别有预算,不能把单个预算视作总进程内存上限。
    • 消息与外部适配:JSON/Protobuf/ROS1/plain XCDR1 解码及回写、时间与质量处理按各自文档约束使用。Python/PyArrow/Foxglove 工具为可选适配器,不属于核心运行依赖。

    快速查询不等于完整校验;需要审核全文件时使用 validate 或 --full。普通查询/裁剪默认最多 100000 条,内存型文件处理默认编码输入预算 64 MiB。已有输出不覆盖;文件发布需要同目录硬链接支持。流式 stdout 失败时可能已有部分结果,需检查退出码。完整约定见 使用边界。

    #按目标查文档

    目标入口
    查询、裁剪、合并和修复CLI、可运行样例、诊断
    选择性 IO、大文件和恢复任务RangeReader、索引、流式片段、外部合并
    解释或修改消息解码、回写、结构演进
    时间、质量和实验处理同步、TF、质量、回归
    可选工具集成列式导出、设备桥接、处理配方

    #验证与数据来源

    moon check moon build moon test --target wasm moon test --target js python tools/check_docs.py python tools/quickstart_smoke.py

    测试方法 区分单元测试、独立参考实现、真实进程中断、干净源码副本、发行包安装和公开数据验证;GitHub CI 保存可复核的报告。公开录制、转换数据和合成样例分别标注,见 公开语料;历史百万消息和大文件实测的环境与限制见 性能报告。设备 SDK 桥接尚未进行实体设备联调。

    0.17.3 追加句柄复用与同步失败回归,见 修复证据。

    本次改进的范围和独立验证记录见 0.17.2 质量记录,完整验证命令及证据判读见 验收入口。历史记录见 0.17.1 质量验证。

    历史验证记录保留在 验证报告 等文件中,版本变化见 更新记录 与 迁移说明。

    从 Mooncakes 全新安装的验证命令为 python tools/install_smoke.py --version 0.17.4,不使用仓库源路径覆盖。

    #开源许可

    项目主体采用 MIT。压缩与字节缓冲的适配组件保留上游 Apache-2.0 许可和来源,见 第三方说明;这些引用实现不计入原创核心源码统计。公开录制文件遵循其发布方的条款,项目 MIT 许可不对它们重新授权。

    McapError

    pub suberror McapError {
    Invalid(String)
    } derive(
    Debug
    )

    AggregateOptions

    pub(all) struct AggregateOptions {
    value_path : String
    group_paths : Array[String]
    by_topic : Bool
    window : UInt64
    origin : UInt64
    max_groups : Int
    group_bytes : Int
    invalid : JsonInvalidPolicy
    }

    AggregateRow

    type AggregateRow

    AggregateRun

    type AggregateRun

    AggregateSpill

    type AggregateSpill

    AggregateState

    type AggregateState

    ArtifactBatchStorage

    pub struct ArtifactBatchStorage {
    load : () -> Bytes? raise McapError
    save : (Bytes) -> Unit raise McapError
    create : (Int) -> WriteSink raise McapError
    seal : (Int) -> Unit raise McapError
    digest : (Int) -> String raise McapError
    publish : (Int) -> Unit raise McapError
    published : (Int) -> Bool raise McapError
    discard : (Int) -> Unit raise McapError
    inventory : () -> Array[Int] raise McapError
    }

    Storage owns exclusive access, durable saves, staged files and publication. publish must be idempotent and must never replace an unrelated output.

    ArtifactReceipt

    type ArtifactReceipt

    Attachment

    pub(all) struct Attachment {
    log_time : UInt64
    create_time : UInt64
    name : String
    media_type : String
    data : Bytes
    } derive(Eq,
    Debug
    )

    Attachment::equal

    fn Attachment::equal(Attachment, Attachment) -> Bool

    Attachment::not_equal

    fn Attachment::not_equal(x : Attachment, y : Attachment) -> Bool

    AttachmentIndex

    pub(all) struct AttachmentIndex {
    offset : UInt64
    length : UInt64
    log_time : UInt64
    create_time : UInt64
    data_size : UInt64
    name : String
    media_type : String
    }

    BinaryField

    pub(all) struct BinaryField {
    path : String
    offset : Int
    byte_length : Int
    elements : Int
    element_type : String
    stride : Int
    little_endian : Bool
    aligned : Bool
    } derive(Eq,
    Debug
    )

    BinaryField::equal

    fn BinaryField::equal(BinaryField, BinaryField) -> Bool

    BinaryField::not_equal

    fn BinaryField::not_equal(x : BinaryField, y : BinaryField) -> Bool

    BlockRecoveryEvidence

    pub(all) struct BlockRecoveryEvidence {
    start : UInt64
    end : UInt64
    recovered : Bool
    messages : Int
    actual_start : UInt64?
    actual_end : UInt64?
    advertised_start : UInt64
    advertised_end : UInt64
    reason : String?
    }

    BlockRecoveryReport

    pub(all) struct BlockRecoveryReport {
    recovered : Array[RecoveredBlock]
    skipped : Array[SkippedBlock]
    messages : Int
    output_bytes : UInt64
    source_complete : Bool
    }

    CachedChunk

    type CachedChunk

    CdrDecoder

    pub struct CdrDecoder {
    name : String
    definitions : Map[String, Array[CdrField]]
    options : CdrOptions
    field_count : Int
    ros1 : Bool
    }

    CdrDecoder::decode

    fn CdrDecoder::decode(self : CdrDecoder, bytes : Bytes) -> Json raise McapError

    CdrDecoder::encode

    fn CdrDecoder::encode(self : CdrDecoder, value : Json, little_endian? : Bool) -> Bytes raise McapError

    CdrDecoder::view

    fn CdrDecoder::view(self : CdrDecoder, bytes : Bytes, selection? : DecodeSelection) -> PayloadView raise McapError

    CdrField

    type CdrField

    CdrOptions

    pub(all) struct CdrOptions {
    schema_bytes : Int
    message_bytes : Int
    string_bytes : Int
    items : Int
    fields : Int
    depth : Int
    int64_as_string : Bool
    }

    CdrProjection

    type CdrProjection

    CdrWire

    type CdrWire

    Channel

    pub(all) struct Channel {
    id : Int
    schema_id : Int
    topic : String
    message_encoding : String
    metadata : Array[(String, String)]
    } derive(Eq,
    Debug
    )

    Channel::equal

    fn Channel::equal(Channel, Channel) -> Bool

    Channel::not_equal

    fn Channel::not_equal(x : Channel, y : Channel) -> Bool

    Channel::to_repr

    Chunk

    pub(all) struct Chunk {
    start_time : UInt64
    end_time : UInt64
    records : Array[Record]
    }

    ChunkIndex

    pub(all) struct ChunkIndex {
    start_time : UInt64
    end_time : UInt64
    chunk_start : UInt64
    chunk_length : UInt64
    message_index_offsets : Array[(Int, UInt64)]
    message_index_length : UInt64
    compression : String
    compressed_size : UInt64
    uncompressed_size : UInt64
    }

    ChunkJobState

    type ChunkJobState

    ChunkPart

    type ChunkPart

    ChunkReadRequest

    pub(all) struct ChunkReadRequest {
    span : ReadSpan
    chunk_bytes : Int
    expanded_bytes : Int
    compression : String
    }

    ChunkSegment

    type ChunkSegment

    ClipStreamOptions

    pub(all) struct ClipStreamOptions {
    context_bytes : Int
    context_messages : Int
    output_messages : UInt64
    output_payload_bytes : UInt64
    pending_bytes : Int
    writer : StreamOptions
    limits : Limits
    }

    ClockAnchor

    pub(all) struct ClockAnchor {
    source : UInt64
    target : UInt64
    }

    ClockMap

    pub struct ClockMap {
    anchors : Array[ClockAnchor]
    extrapolate : Bool
    }

    ClockMap::json

    fn ClockMap::json(self : ClockMap) -> Json

    ClockMap::map

    fn ClockMap::map(self : ClockMap, time : UInt64) -> UInt64 raise McapError

    ClockMap::residuals

    fn ClockMap::residuals(self : ClockMap, probes : Array[ClockAnchor]) -> Json raise McapError

    Independent held-out probes; anchor interpolation residual alone is not evidence of calibration accuracy. Signed residual is predicted minus target.

    CommandOptions

    pub(all) struct CommandOptions {
    command : String
    inputs : Array[String]
    output : String
    query : Query
    compression : Compression
    format : String
    max_file_bytes : Int
    cache_bytes : Int
    chunk_messages : Int
    full : Bool
    transform : TransformOptions
    external : ExternalOptions
    temp_dir : String
    indexes : Array[String]
    fast_index : Bool
    index_bytes : Int
    content : JsonFilter?
    job_dir : String
    resume_job : Bool
    aggregate : AggregateOptions
    diff : DiffOptions
    }

    Compression

    pub(all) enum Compression {
    Uncompressed
    Lz4
    Zstd
    } derive(Eq,
    Debug
    )

    Compression::equal

    fn Compression::equal(Compression, Compression) -> Bool

    Compression::name

    fn Compression::name(self : Compression) -> String

    Compression::not_equal

    fn Compression::not_equal(x : Compression, y : Compression) -> Bool

    ContextClip

    pub(all) struct ContextClip {
    log : Log
    report : Json
    }

    ContextRule

    pub(all) struct ContextRule {
    topic : String
    depth : Int
    max_age : UInt64
    required : Bool
    }

    Cursor

    type Cursor

    CursorRun

    type CursorRun

    DataInspection

    type DataInspection

    Dataset

    pub struct Dataset {
    sources : Array[QuerySource]
    declarations : Log
    remaps : Array[Map[Int, Int]]
    limits : Limits
    }

    Dataset::channels

    fn Dataset::channels(self : Dataset) -> Array[Channel]

    Dataset::cursor

    fn Dataset::cursor(self : Dataset, query : Query, pending_bytes? : Int) -> DatasetCursor raise McapError

    Dataset::remap_message

    fn Dataset::remap_message(self : Dataset, source_index : Int, message : Message) -> Message raise McapError

    Dataset::schemas

    fn Dataset::schemas(self : Dataset) -> Array[Schema]

    DatasetCursor

    pub struct DatasetCursor {
    dataset : Dataset
    original : Query
    budget : Int
    streams : Array[MessageStream]
    heap : Array[DatasetMessage]
    query : Query
    state : FileCursorState
    initialized : Bool
    loaded : Int
    advance : Int?
    remaining : Int
    offset_left : Int
    emitted : Int
    skipped : Int
    peak : Int
    }

    DatasetCursor::cancel

    fn DatasetCursor::cancel(self : DatasetCursor) -> Unit

    DatasetCursor::next

    fn DatasetCursor::next(self : DatasetCursor) -> Message? raise McapError

    DatasetCursor::next_page

    fn DatasetCursor::next_page(self : DatasetCursor, size : Int) -> Array[DatasetMessage] raise McapError

    DatasetCursor::next_record

    fn DatasetCursor::next_record(self : DatasetCursor) -> DatasetMessage? raise McapError

    DatasetCursor::progress

    DatasetCursor::seek

    fn DatasetCursor::seek(self : DatasetCursor, time : UInt64) -> Unit raise McapError

    DatasetCursor::write_ndjson

    fn DatasetCursor::write_ndjson(self : DatasetCursor, sink : WriteSink) -> Int raise McapError

    DatasetMessage

    pub(all) struct DatasetMessage {
    source_index : Int
    message : Message
    } derive(Eq,
    Debug
    )

    DatasetMessage::equal

    DatasetMessage::not_equal

    fn DatasetMessage::not_equal(x : DatasetMessage, y : DatasetMessage) -> Bool

    DatasetProgress

    pub(all) struct DatasetProgress {
    state : FileCursorState
    sources : Int
    materialized_sources : Int
    loaded_sources : Int
    emitted_messages : Int
    skipped_messages : Int
    pending_bytes : Int
    peak_pending_bytes : Int
    } derive(Eq,
    Debug
    )

    DatasetProgress::equal

    DatasetProgress::not_equal

    fn DatasetProgress::not_equal(x : DatasetProgress, y : DatasetProgress) -> Bool

    DecodeSelection

    pub(all) struct DecodeSelection {
    paths : Array[String]
    inline_array_items : Int
    scan_items : Int
    } derive(Eq,
    Debug
    )

    DecodeSelection::equal

    DecodeSelection::not_equal

    fn DecodeSelection::not_equal(x : DecodeSelection, y : DecodeSelection) -> Bool

    Diagnostic

    pub(all) struct Diagnostic {
    code : DiagnosticCode
    offset : UInt64?
    opcode : Byte?
    message : String
    expected : UInt64?
    actual : UInt64?
    } derive(Eq,
    Debug
    )

    Diagnostic::equal

    fn Diagnostic::equal(Diagnostic, Diagnostic) -> Bool

    Diagnostic::not_equal

    fn Diagnostic::not_equal(x : Diagnostic, y : Diagnostic) -> Bool

    DiagnosticCode

    pub(all) enum DiagnosticCode {
    BadEnvelope
    BadRecord
    BadDeclaration
    BadCompression
    BadChecksum
    BadIndex
    BadSummary
    TruncatedInput
    LimitExceeded
    } derive(Eq,
    Debug
    )

    DiagnosticCode::equal

    DiagnosticCode::name

    fn DiagnosticCode::name(self : DiagnosticCode) -> String

    DiagnosticCode::not_equal

    fn DiagnosticCode::not_equal(x : DiagnosticCode, y : DiagnosticCode) -> Bool

    DiffBag

    type DiffBag

    DiffOptions

    pub(all) struct DiffOptions {
    json_payloads : Bool
    bucket_bytes : Int
    auxiliary_bytes : Int
    max_details : Int
    detail_bytes : Int
    fallback_bytes : Int
    limits : Limits
    }

    DiffResult

    type DiffResult

    DiskIndexEntry

    type DiskIndexEntry

    DiskSidecarAudit

    pub struct DiskSidecarAudit {
    reader : DiskSidecarReader
    page : Int
    previous : DiskIndexEntry?
    failed : Bool
    }

    DiskSidecarAudit::feed

    fn DiskSidecarAudit::feed(self : DiskSidecarAudit, bytes : Bytes) -> Unit raise McapError

    DiskSidecarAudit::finish

    DiskSidecarAudit::poll

    DiskSidecarCursor

    pub struct DiskSidecarCursor {
    reader : DiskSidecarReader
    original : Query
    allowed : Map[Int, Bool]
    query : Query
    position : Int
    offset : Int
    remaining : Int
    state : FileCursorState
    }

    DiskSidecarCursor::cancel

    fn DiskSidecarCursor::cancel(self : DiskSidecarCursor) -> Unit

    DiskSidecarCursor::next

    DiskSidecarCursor::next_page

    fn DiskSidecarCursor::next_page(self : DiskSidecarCursor, size : Int) -> Array[Message] raise McapError

    DiskSidecarCursor::seek

    fn DiskSidecarCursor::seek(self : DiskSidecarCursor, time : UInt64) -> Unit raise McapError

    DiskSidecarPoll

    pub(all) enum DiskSidecarPoll {
    DiskDone
    DiskMessage(Message)
    DiskIndexRead(ReadSpan)
    DiskSourceRead(ReadSpan)
    }

    DiskSidecarPollCursor

    pub struct DiskSidecarPollCursor {
    reader : DiskSidecarReader
    original : Query
    allowed : Map[Int, Bool]
    query : Query
    low : Int
    high : Int
    searching : Bool
    position : Int
    offset : Int
    remaining : Int
    state : FileCursorState
    current : (Int, Array[DiskIndexEntry])?
    waiting_page : Int?
    waiting_entry : SidecarEntry?
    ready : Message?
    }

    DiskSidecarPollCursor::cancel

    fn DiskSidecarPollCursor::cancel(self : DiskSidecarPollCursor) -> Unit

    DiskSidecarPollCursor::feed_index

    fn DiskSidecarPollCursor::feed_index(self : DiskSidecarPollCursor, bytes : Bytes) -> Unit raise McapError

    DiskSidecarPollCursor::feed_source

    fn DiskSidecarPollCursor::feed_source(self : DiskSidecarPollCursor, bytes : Bytes, expanded? : Bytes) -> Unit raise McapError

    DiskSidecarPollCursor::pending_bytes

    fn DiskSidecarPollCursor::pending_bytes(self : DiskSidecarPollCursor) -> Int

    DiskSidecarPollCursor::poll

    DiskSidecarPollCursor::seek

    fn DiskSidecarPollCursor::seek(self : DiskSidecarPollCursor, time : UInt64) -> Unit raise McapError

    DiskSidecarPollCursor::skip_source

    fn DiskSidecarPollCursor::skip_source(self : DiskSidecarPollCursor) -> Unit raise McapError

    DiskSidecarReader

    pub struct DiskSidecarReader {
    index : ReadSource
    base : SidecarReader
    count : Int
    width : Int
    start : UInt64
    cache_limit : Int
    pages : Array[(Int, Array[DiskIndexEntry])]
    page_reads : Int
    cache_hits : Int
    peak_pages : Int
    }

    DiskSidecarReader::channels

    DiskSidecarReader::cursor

    DiskSidecarReader::declaration_log

    fn DiskSidecarReader::declaration_log(self : DiskSidecarReader) -> Log

    DiskSidecarReader::info

    DiskSidecarReader::poll_cursor

    fn DiskSidecarReader::poll_cursor(self : DiskSidecarReader, query : Query) -> DiskSidecarPollCursor raise McapError

    DiskSidecarReader::query_source

    fn DiskSidecarReader::query_source(self : DiskSidecarReader) -> QuerySource raise McapError

    DiskSidecarReader::validate_entries

    fn DiskSidecarReader::validate_entries(self : DiskSidecarReader) -> Unit raise McapError

    EventDetector

    pub struct EventDetector {
    rule : EventRule
    enter : JsonFilter
    leave : JsonFilter?
    previous : UInt64?
    candidate : UInt64?
    confirmed : UInt64?
    ended : UInt64?
    finished : Bool
    }

    EventDetector::feed

    fn EventDetector::feed(self : EventDetector, message : Message) -> Array[EventSignal] raise McapError

    Feed only this rule's topic, in ascending log-time order. Continuity is sampled evidence; a long gap closes an active event as incomplete.

    EventDetector::finish

    fn EventDetector::finish(self : EventDetector) -> EventSpan?

    EventRule

    pub(all) struct EventRule {
    topic : String
    enter : String
    leave : String?
    duration : UInt64
    max_gap : UInt64
    cooldown : UInt64
    pre : UInt64
    post : UInt64
    }

    EventSignal

    pub(all) enum EventSignal {
    EventStarted(UInt64, UInt64)
    EventClosed(EventSpan)
    }

    EventSpan

    pub(all) struct EventSpan {
    start : UInt64
    confirmed : UInt64
    end : UInt64
    closed : Bool
    } derive(Eq,
    Debug
    )

    EventSpan::equal

    fn EventSpan::equal(EventSpan, EventSpan) -> Bool

    EventSpan::not_equal

    fn EventSpan::not_equal(x : EventSpan, y : EventSpan) -> Bool

    EventWindow

    pub(all) struct EventWindow {
    start : UInt64
    end : UInt64
    events : Array[EventSpan]
    }

    ExactDecimal

    type ExactDecimal

    ExternalOptions

    pub(all) struct ExternalOptions {
    run_bytes : Int
    merge_bytes : Int
    fan_in : Int
    spool_bytes : UInt64
    run_limit : Int
    declaration_bytes : Int
    limits : Limits
    output : StreamOptions
    }

    ExternalReport

    pub(all) struct ExternalReport {
    input_files : Int
    messages : UInt64
    runs_created : Int
    merge_passes : Int
    peak_run_bytes : Int
    peak_merge_bytes : Int
    peak_spool_bytes : UInt64
    output_bytes : UInt64
    }

    FieldBounds

    type FieldBounds

    FieldIndex

    pub struct FieldIndex {
    digest : String
    size : UInt64
    decoder_identity : String
    paths : Array[String]
    zones : Map[UInt64, FieldZone]
    }

    FieldIndex::info

    fn FieldIndex::info(self : FieldIndex) -> Json

    FieldIndex::location_filter

    fn FieldIndex::location_filter(self : FieldIndex, filter : JsonFilter) -> ((UInt64, Int) -> Bool raise McapError) raise McapError

    Conservative physical-region predicate. Missing and differently sized regions remain candidates. Always apply the exact payload predicate after pruning.

    FieldIndex::to_bytes

    fn FieldIndex::to_bytes(self : FieldIndex, max_bytes? : Int) -> Bytes raise McapError

    FieldPage

    pub struct FieldPage {
    index : FieldIndex
    blooms : Map[UInt64, Array[Bytes]]
    first : UInt64
    end : UInt64
    }

    FieldPage::end_offset

    fn FieldPage::end_offset(self : FieldPage) -> UInt64

    FieldPage::first_offset

    fn FieldPage::first_offset(self : FieldPage) -> UInt64

    FieldPage::may_match

    fn FieldPage::may_match(self : FieldPage, offset : UInt64, span : Int, filter : JsonFilter) -> Bool raise McapError

    FieldPageLayout

    pub(all) struct FieldPageLayout {
    header_bytes : Int
    page_bytes : Int
    pages : Int
    } derive(Eq,
    Debug
    )

    FieldPageLayout::equal

    FieldPageLayout::not_equal

    fn FieldPageLayout::not_equal(x : FieldPageLayout, y : FieldPageLayout) -> Bool

    FieldQueryPlan

    pub struct FieldQueryPlan {
    reader : RangeReader
    filter : JsonFilter
    decoder : PayloadDecoder
    all_skipped : Bool
    total : Int
    skipped : Int
    start_bytes : UInt64
    }

    FieldQueryPlan::info

    fn FieldQueryPlan::info(self : FieldQueryPlan) -> Json

    FieldQueryPlan::query_source

    fn FieldQueryPlan::query_source(self : FieldQueryPlan) -> QuerySource raise McapError

    FieldZone

    type FieldZone

    FileCursor

    pub struct FileCursor {
    reader : RangeReader
    original : Query
    candidates : Array[ChunkIndex]
    heap : Array[FileItem]
    allowed : Map[Int, Bool]
    pending_budget : Int
    span_budget : Int
    active : Query
    fallback : QueryCursor?
    state : FileCursorState
    loaded : Int
    visited : Int
    emitted : Int
    skipped : Int
    offset_left : Int
    remaining : Int
    pending_bytes : Int
    peak_pending : Int
    }

    FileCursor::cancel

    fn FileCursor::cancel(self : FileCursor) -> Unit

    FileCursor::current_chunk_location

    fn FileCursor::current_chunk_location(self : FileCursor) -> MessageLocation raise McapError

    FileCursor::feed

    fn FileCursor::feed(self : FileCursor, bytes : Bytes) -> Unit raise McapError

    FileCursor::feed_expanded

    fn FileCursor::feed_expanded(self : FileCursor, original : Bytes, expanded : Bytes) -> Unit raise McapError

    Host worker must be trusted; original properties, output CRC and indexes are checked.

    FileCursor::next

    fn FileCursor::next(self : FileCursor) -> Message? raise McapError

    FileCursor::next_page

    fn FileCursor::next_page(self : FileCursor, size : Int) -> Array[Message] raise McapError

    FileCursor::poll

    fn FileCursor::poll(self : FileCursor) -> FilePoll raise McapError

    Nonblocking protocol: perform FileRead externally, then feed exactly its bytes.

    FileCursor::progress

    fn FileCursor::progress(self : FileCursor) -> FileProgress

    FileCursor::seek

    fn FileCursor::seek(self : FileCursor, time : UInt64) -> Unit raise McapError

    FileCursor::skip_chunk

    fn FileCursor::skip_chunk(self : FileCursor) -> Unit raise McapError

    Skip an externally rejected region without consuming result offset/limit.

    FileCursor::upcoming_reads

    fn FileCursor::upcoming_reads(self : FileCursor, maximum : Int) -> Array[ChunkReadRequest] raise McapError

    FileCursor::write_ndjson

    fn FileCursor::write_ndjson(self : FileCursor, sink : WriteSink) -> Int raise McapError

    FileCursorState

    pub(all) enum FileCursorState {
    FileActive
    FileExhausted
    FileCancelled
    FileFailed
    } derive(Eq,
    Debug
    )

    FileCursorState::equal

    FileCursorState::not_equal

    fn FileCursorState::not_equal(x : FileCursorState, y : FileCursorState) -> Bool

    FileDiagnosis

    pub(all) struct FileDiagnosis {
    valid : Bool
    data_valid : Bool
    data_crc_verified : Bool
    messages : Int
    chunks : Int
    data_end : UInt64?
    issues : Array[Diagnostic]
    } derive(Eq,
    Debug
    )

    FileDiagnosis::equal

    FileDiagnosis::not_equal

    fn FileDiagnosis::not_equal(x : FileDiagnosis, y : FileDiagnosis) -> Bool

    FileItem

    type FileItem

    FilePoll

    pub(all) enum FilePoll {
    FileMessage(Message)
    FileRead(ReadSpan)
    FileDone
    }

    FileProgress

    pub(all) struct FileProgress {
    state : FileCursorState
    candidate_chunks : Int
    loaded_chunks : Int
    emitted_messages : Int
    skipped_messages : Int
    pending_messages : Int
    pending_bytes : Int
    peak_pending_bytes : Int
    used_fallback : Bool
    } derive(Eq,
    Debug
    )

    FileProgress::equal

    FileProgress::not_equal

    fn FileProgress::not_equal(x : FileProgress, y : FileProgress) -> Bool

    FileStatistics

    pub(all) struct FileStatistics {
    message_count : UInt64
    schema_count : Int
    channel_count : UInt
    attachment_count : UInt
    metadata_count : UInt
    chunk_count : UInt
    start_time : UInt64
    end_time : UInt64
    channel_message_counts : Array[(Int, UInt64)]
    } derive(Eq,
    Debug
    )

    MCAP Statistics record (opcode 0x0b), distinct from timing diagnostics.

    FileStatistics::equal

    FileStatistics::not_equal

    fn FileStatistics::not_equal(x : FileStatistics, y : FileStatistics) -> Bool

    pub(all) struct Footer {
    summary_start : UInt64
    summary_offset_start : UInt64
    summary_crc : UInt
    } derive(Eq,
    Debug
    )

    Footer::equal

    fn Footer::equal(Footer, Footer) -> Bool

    Footer::not_equal

    fn Footer::not_equal(x : Footer, y : Footer) -> Bool

    Footer::to_repr

    GrowingTail

    pub struct GrowingTail {
    identity : String
    fingerprint : (ReadSource) -> String raise McapError
    limits : Limits
    batch_bytes : Int
    offset : UInt64
    digest : String
    declarations : Log
    header_seen : Bool
    data_end : Bool
    complete : Bool
    }

    GrowingTail::poll

    fn GrowingTail::poll(self : GrowingTail, source : ReadSource, units? : Int) -> LiveBatch raise McapError

    Poll a stable size snapshot of an append-only file. Committed prefix hashes are rechecked; incomplete record headers/bodies wait without advancing. Returned early messages have only available per-record/chunk verification.

    GrowingTail::snapshot

    fn GrowingTail::snapshot(self : GrowingTail) -> Bytes raise McapError

    pub(all) struct Header {
    profile : String
    library : String
    } derive(Eq,
    Debug
    )

    Header::equal

    fn Header::equal(Header, Header) -> Bool

    Header::not_equal

    fn Header::not_equal(x : Header, y : Header) -> Bool

    Header::to_repr

    IndexRepair

    pub(all) struct IndexRepair {
    bytes : Bytes
    original : FileDiagnosis
    result : FileDiagnosis
    }

    IndexVerification

    pub(all) enum IndexVerification {
    VerifyContent((ReadSource) -> String raise McapError)
    TrustIdentity(String)
    }

    JoinMode

    pub(all) enum JoinMode {
    JoinAsOf
    JoinNearest
    } derive(Eq,
    Debug
    )

    JoinMode::equal

    fn JoinMode::equal(JoinMode, JoinMode) -> Bool

    JoinMode::not_equal

    fn JoinMode::not_equal(x : JoinMode, y : JoinMode) -> Bool

    JoinMode::to_repr

    JoinOptions

    pub(all) struct JoinOptions {
    mode : JoinMode
    tolerance : UInt64
    missing : MissingMatch
    buffer_bytes : Int
    buffer_messages : Int
    } derive(Eq,
    Debug
    )

    JoinOptions::equal

    fn JoinOptions::equal(JoinOptions, JoinOptions) -> Bool

    JoinOptions::not_equal

    fn JoinOptions::not_equal(x : JoinOptions, y : JoinOptions) -> Bool

    JoinPoll

    pub(all) enum JoinPoll {
    JoinReadLeft
    JoinReadRight
    JoinRow(TemporalMatch)
    JoinDone
    }

    JsonCondition

    type JsonCondition

    JsonDocumentParser

    type JsonDocumentParser

    JsonFilter

    pub struct JsonFilter {
    condition : JsonCondition
    projections : Array[(String, Array[String])]
    policy : JsonInvalidPolicy
    maximum : Int
    depth : Int
    }

    JsonFilter::matches

    fn JsonFilter::matches(self : JsonFilter, payload : Bytes) -> Bool raise McapError

    JsonFilter::project

    fn JsonFilter::project(self : JsonFilter, payload : Bytes) -> Json raise McapError

    JsonFilter::required_paths

    fn JsonFilter::required_paths(self : JsonFilter) -> Array[String]

    JsonFilter::selected_paths

    fn JsonFilter::selected_paths(self : JsonFilter) -> Array[String]

    JsonInvalidPolicy

    pub(all) enum JsonInvalidPolicy {
    JsonError
    JsonSkip
    } derive(Eq)

    JsonInvalidPolicy::equal

    JsonInvalidPolicy::not_equal

    fn JsonInvalidPolicy::not_equal(x : JsonInvalidPolicy, y : JsonInvalidPolicy) -> Bool

    Limits

    pub(all) struct Limits {
    max_record_bytes : Int
    max_string_bytes : Int
    max_records : Int
    max_decompressed_bytes : Int
    } derive(Eq,
    Debug
    )

    Limits::equal

    fn Limits::equal(Limits, Limits) -> Bool

    Limits::not_equal

    fn Limits::not_equal(x : Limits, y : Limits) -> Bool

    Limits::to_repr

    LiveBatch

    pub(all) struct LiveBatch {
    declarations : Log
    messages : Array[Message]
    evidence : Json
    }

    LiveQuality

    pub struct LiveQuality {
    states : Array[QualityState]
    settings : Json
    start : UInt64
    lateness : UInt64
    pending_limit : Int
    pending : Array[LiveQualityItem]
    maximum : UInt64?
    watermark : UInt64?
    late : UInt64
    inputs : UInt64
    finished : Bool
    }

    LiveQuality::advance

    fn LiveQuality::advance(self : LiveQuality, watermark : UInt64) -> Unit raise McapError

    LiveQuality::feed

    fn LiveQuality::feed(self : LiveQuality, topic : String, message : Message) -> Bool raise McapError

    False means an explicitly counted late observation was excluded. Watermarks are closed: a later arrival at or below the watermark cannot retract results.

    LiveQuality::finish

    fn LiveQuality::finish(self : LiveQuality, end : UInt64) -> Unit raise McapError

    LiveQuality::report

    fn LiveQuality::report(self : LiveQuality) -> Json

    LiveQuality::snapshot

    fn LiveQuality::snapshot(self : LiveQuality) -> Bytes raise McapError

    LiveQualityItem

    type LiveQualityItem

    Log

    pub(all) struct Log {
    header : Header
    schemas : Array[Schema]
    channels : Array[Channel]
    messages : Array[Message]
    metadata : Array[Metadata]
    attachments : Array[Attachment]
    } derive(Eq,
    Debug
    )

    Log::equal

    fn Log::equal(Log, Log) -> Bool

    Log::not_equal

    fn Log::not_equal(x : Log, y : Log) -> Bool

    Log::to_repr

    LogBuilder

    pub struct LogBuilder {
    log : Log
    limits : Limits
    closed : Bool
    next_schema : Int
    next_channel : Int
    sequences : Map[Int, UInt]
    }

    Stateful recorder. Failed additions are atomic and finishing freezes the builder.

    LogBuilder::add_attachment

    fn LogBuilder::add_attachment(self : LogBuilder, value : Attachment) -> Unit raise McapError

    LogBuilder::add_metadata

    fn LogBuilder::add_metadata(self : LogBuilder, value : Metadata) -> Unit raise McapError

    LogBuilder::append

    fn LogBuilder::append(self : LogBuilder, channel_id : Int, log_time : UInt64, data : Bytes, publish_time? : UInt64) -> Unit raise McapError

    LogBuilder::finish

    fn LogBuilder::finish(self : LogBuilder, indexed? : Bool, messages_per_chunk? : Int, compression? : Compression) -> Bytes raise McapError

    LogBuilder::message_count

    fn LogBuilder::message_count(self : LogBuilder) -> Int

    LogBuilder::register_channel

    fn LogBuilder::register_channel(self : LogBuilder, topic : String, message_encoding : String, schema_id? : Int, metadata? : Array[(String, String)]) -> Int raise McapError

    LogBuilder::register_schema

    fn LogBuilder::register_schema(self : LogBuilder, name : String, encoding : String, data : Bytes) -> Int raise McapError

    LogBuilder::snapshot

    fn LogBuilder::snapshot(self : LogBuilder) -> Log

    LogStats

    pub(all) struct LogStats {
    schema_count : Int
    channel_count : Int
    message_count : Int
    payload_bytes : UInt64
    topics : Array[TopicStats]
    }

    MergeState

    type MergeState

    Message

    pub(all) struct Message {
    channel_id : Int
    sequence : UInt
    log_time : UInt64
    publish_time : UInt64
    data : Bytes
    } derive(Eq,
    Debug
    )

    Message::equal

    fn Message::equal(Message, Message) -> Bool

    Message::not_equal

    fn Message::not_equal(x : Message, y : Message) -> Bool

    Message::to_repr

    MessageIndex

    pub(all) struct MessageIndex {
    channel_id : Int
    entries : Array[(UInt64, UInt64)]
    }

    MessageLocation

    pub(all) struct MessageLocation {
    offset : UInt64
    span : Int
    inner : Int?
    } derive(Eq,
    Debug
    )

    MessageLocation::equal

    MessageLocation::not_equal

    fn MessageLocation::not_equal(x : MessageLocation, y : MessageLocation) -> Bool

    MessageStream

    pub struct MessageStream {
    next_message : () -> Message? raise McapError
    stop : () -> Unit
    pending : () -> Int
    }

    MessageStream::cancel

    fn MessageStream::cancel(self : MessageStream) -> Unit

    MessageStream::next

    fn MessageStream::next(self : MessageStream) -> Message? raise McapError

    Metadata

    pub(all) struct Metadata {
    name : String
    entries : Array[(String, String)]
    } derive(Eq,
    Debug
    )

    Metadata::equal

    fn Metadata::equal(Metadata, Metadata) -> Bool

    Metadata::not_equal

    fn Metadata::not_equal(x : Metadata, y : Metadata) -> Bool

    Metadata::to_repr

    MetadataIndex

    pub(all) struct MetadataIndex {
    offset : UInt64
    length : UInt64
    name : String
    }

    MissingMatch

    pub(all) enum MissingMatch {
    JoinKeep
    JoinDrop
    } derive(Eq,
    Debug
    )

    MissingMatch::equal

    MissingMatch::not_equal

    fn MissingMatch::not_equal(x : MissingMatch, y : MissingMatch) -> Bool

    NormalizedConversion

    pub(all) enum NormalizedConversion {
    KeepValue
    SignedValue(Int)
    UnsignedValue(Int)
    ScaleValue(Double, Double)
    TextValue
    BooleanValue
    }

    NormalizedField

    pub(all) struct NormalizedField {
    source : String
    target : String
    default_value : Json?
    required : Bool
    conversion : NormalizedConversion
    }

    NormalizedPayload

    pub(all) struct NormalizedPayload {
    value : Json
    defaulted : Array[String]
    missing : Array[String]
    }

    PagedFieldHeader

    pub struct PagedFieldHeader {
    template : FieldIndex
    layout : FieldPageLayout
    }

    PagedFieldHeader::decode_page

    fn PagedFieldHeader::decode_page(self : PagedFieldHeader, bytes : Bytes) -> FieldPage raise McapError

    PagedFieldHeader::layout

    PayloadDecoder

    pub struct PayloadDecoder {
    decode_payload : (Schema?, Channel, Bytes) -> Json raise McapError
    }

    PayloadDecoder::decode_message

    fn PayloadDecoder::decode_message(self : PayloadDecoder, message : Message, declarations : Log, max_bytes? : Int) -> Message raise McapError

    PayloadDecoder::require_filter_fields

    fn PayloadDecoder::require_filter_fields(self : PayloadDecoder, filter : JsonFilter) -> PayloadDecoder raise McapError

    Fail explicitly when an exact condition would inspect an opaque array.

    PayloadEdit

    pub(all) struct PayloadEdit {
    path : String
    replacement : Json?
    }

    None removes an object member or array element. Set replaces the addressed value, or adds a final object member. Parent containers must already exist.

    PayloadNormalizer

    pub struct PayloadNormalizer {
    fields : Array[NormalizedField]
    paths : Array[(Array[String], Array[String])]
    }

    PayloadNormalizer::normalize

    fn PayloadNormalizer::normalize(self : PayloadNormalizer, document : Json) -> NormalizedPayload raise McapError

    PayloadOutput

    type PayloadOutput

    PayloadRewriter

    pub struct PayloadRewriter {
    apply : (Schema?, Channel, Bytes, Array[PayloadEdit]) -> Bytes raise McapError
    }

    PayloadRewriter::rewrite

    fn PayloadRewriter::rewrite(self : PayloadRewriter, schema : Schema?, channel : Channel, payload : Bytes, edits : Array[PayloadEdit]) -> Bytes raise McapError

    PayloadRewriter::rewrite_message

    fn PayloadRewriter::rewrite_message(self : PayloadRewriter, message : Message, declarations : Log, edits : Array[PayloadEdit]) -> Message raise McapError

    PayloadView

    pub struct PayloadView {
    source : Bytes
    value : Json
    binary : Map[String, BinaryField]
    visited : Int
    }

    PayloadView::binary_fields

    fn PayloadView::binary_fields(self : PayloadView) -> Array[BinaryField]

    PayloadView::info

    fn PayloadView::info(self : PayloadView) -> Json

    PayloadView::json

    fn PayloadView::json(self : PayloadView) -> Json

    PayloadView::read_binary

    fn PayloadView::read_binary(self : PayloadView, path : String, offset : Int, length : Int, max_bytes? : Int) -> Bytes raise McapError

    Offsets are relative to a field's raw payload bytes, excluding array count.

    PayloadView::read_elements

    fn PayloadView::read_elements(self : PayloadView, path : String, start : Int, count : Int, max_elements? : Int) -> Json raise McapError

    PayloadView::write_binary

    fn PayloadView::write_binary(self : PayloadView, path : String, sink : WriteSink, block_bytes? : Int, cancelled? : () -> Bool) -> UInt64 raise McapError

    ProtoCache

    type ProtoCache

    ProtoEnum

    type ProtoEnum

    ProtoField

    type ProtoField

    ProtoItem

    type ProtoItem

    ProtoMessage

    type ProtoMessage

    ProtoSlice

    type ProtoSlice

    ProtoValue

    type ProtoValue

    ProtoWire

    type ProtoWire

    ProtobufDecoder

    pub struct ProtobufDecoder {
    messages : Map[String, ProtoMessage]
    enums : Map[String, ProtoEnum]
    options : ProtobufOptions
    field_count : Array[Int]
    }

    ProtobufDecoder::decode

    fn ProtobufDecoder::decode(self : ProtobufDecoder, name : String, payload : Bytes) -> Json raise McapError

    ProtobufDecoder::decode_selected

    fn ProtobufDecoder::decode_selected(self : ProtobufDecoder, name : String, payload : Bytes, selection : DecodeSelection) -> Json raise McapError

    Skips materializing unrequested top-level fields. Selected nested messages retain normal merge/map/oneof semantics before the final nested projection.

    ProtobufDecoder::encode

    fn ProtobufDecoder::encode(self : ProtobufDecoder, name : String, value : Json) -> Bytes raise McapError

    Encode the decoder's ordinary object representation. ProtoJSON well-known type mappings are deliberately rejected; use protobuf_options() instead.

    ProtobufDecoder::rewrite

    fn ProtobufDecoder::rewrite(self : ProtobufDecoder, name : String, bytes : Bytes, edits : Array[PayloadEdit]) -> Bytes raise McapError

    Preserve untouched wire slices and unknown fields. Nested singular message edits merge their occurrences; replacing an entire submessage intentionally replaces its unknown contents as well.

    ProtobufOptions

    pub(all) struct ProtobufOptions {
    descriptor_bytes : Int
    message_bytes : Int
    depth : Int
    items : Int
    fields : Int
    int64_as_string : Bool
    protojson : Bool
    emit_defaults : Bool
    }

    QualityRule

    pub(all) struct QualityRule {
    topic : String
    minimum_messages : Int
    max_gap : UInt64?
    check_sequence : Bool
    condition : String?
    warning : Bool
    }

    QualityState

    type QualityState

    Query

    pub(all) struct Query {
    topics : Array[String]
    start_time : UInt64
    end_time : UInt64
    descending : Bool
    offset : Int
    limit : Int
    }

    QueryCursor

    pub struct QueryCursor {
    index : QueryIndex
    query : Query
    heap : Array[CursorRun]
    state : QueryCursorState
    matching : Int
    skipped : Int
    emitted : Int
    remaining : Int
    }

    A cursor shares the index's immutable snapshot, retaining one head per run. It does not retain a second array of all matching messages or reread files.

    QueryCursor::cancel

    fn QueryCursor::cancel(self : QueryCursor) -> Unit

    Cancellation is terminal and idempotent, releasing pending run references.

    QueryCursor::next

    fn QueryCursor::next(self : QueryCursor) -> Message?

    Return the next message, or None after exhaustion/cancellation.

    QueryCursor::next_page

    fn QueryCursor::next_page(self : QueryCursor, size : Int) -> Array[Message] raise McapError

    Page size must be positive. An invalid size leaves cursor position unchanged.

    QueryCursor::progress

    fn QueryCursor::progress(self : QueryCursor) -> QueryProgress

    QueryCursor::seek

    fn QueryCursor::seek(self : QueryCursor, time : UInt64) -> Unit raise McapError

    Restart inclusively at time within the original interval, in query direction. Offset is not reapplied; limit and progress restart. Cancelled cursors stay closed. Seeking outside the original interval fails without changing traversal state.

    QueryCursorState

    pub(all) enum QueryCursorState {
    Active
    Exhausted
    Cancelled
    } derive(Eq,
    Debug
    )

    QueryCursorState::equal

    QueryCursorState::not_equal

    fn QueryCursorState::not_equal(x : QueryCursorState, y : QueryCursorState) -> Bool

    QueryDiagnostics

    pub(all) struct QueryDiagnostics {
    total_chunks : Int
    candidate_chunks : Int
    matching_messages : Int
    used_file_indexes : Bool
    }

    QueryIndex

    pub struct QueryIndex {
    log : Log
    by_channel : Map[Int, Array[Int]]
    all_messages : Array[Int]
    }

    An in-memory time index, not an on-disk MCAP MessageIndex.

    QueryIndex::cursor

    fn QueryIndex::cursor(self : QueryIndex, query : Query) -> QueryCursor raise McapError

    Offset/limit apply once across all pages. Duplicate topic filters are harmless. The snapshot is shared with the index; returned message values and Bytes are immutable.

    QueryIndex::query

    fn QueryIndex::query(self : QueryIndex, query : Query) -> Array[Message] raise McapError

    QueryIndex::query_source

    fn QueryIndex::query_source(self : QueryIndex) -> QuerySource raise McapError

    QueryProgress

    pub(all) struct QueryProgress {
    state : QueryCursorState
    matching_messages : Int
    skipped_messages : Int
    emitted_messages : Int
    remaining_messages : Int
    buffered_heads : Int
    } derive(Eq,
    Debug
    )

    Counts refer to the current traversal, reset by seek. Remaining respects limit.

    QueryProgress::equal

    QueryProgress::not_equal

    fn QueryProgress::not_equal(x : QueryProgress, y : QueryProgress) -> Bool

    QueryResult

    pub(all) struct QueryResult {
    messages : Array[Message]
    diagnostics : QueryDiagnostics
    }

    QuerySource

    pub struct QuerySource {
    declarations : Log
    open : (Query, Int) -> MessageStream raise McapError
    materialized : Bool
    }

    QuerySource::calibrate_time

    fn QuerySource::calibrate_time(self : QuerySource, mapping : ClockMap, same_publish_clock? : Bool) -> QuerySource raise McapError

    Query times and pagination are in corrected log-time. Scan the original calibrated domain and filter exactly, avoiding unsafe inverse rounding.

    QuerySource::declaration_log

    fn QuerySource::declaration_log(self : QuerySource) -> Log

    QuerySource::decode_payload

    fn QuerySource::decode_payload(self : QuerySource, decoder : PayloadDecoder, max_bytes? : Int) -> QuerySource raise McapError

    QuerySource::filter_json

    fn QuerySource::filter_json(self : QuerySource, filter : JsonFilter) -> QuerySource raise McapError

    QuerySource::stream

    fn QuerySource::stream(self : QuerySource, query? : Query, pending_bytes? : Int) -> MessageStream raise McapError

    Open a source-local message stream without Dataset ID remapping. The caller must cancel on early termination. Source ordering and limits follow Query.

    RangeReader

    pub struct RangeReader {
    source : ReadSource
    limits : Limits
    declarations : Log
    indexes : Array[ChunkIndex]
    cache : Array[CachedChunk]
    cache_budget : Int
    fallback_budget : Int
    data_end : UInt64
    cache_bytes : Int
    peak_cache_bytes : Int
    decoded_chunks : Int
    cache_hits : Int
    full_validation : Bool
    }

    Summary-checked selective reader. Unread data and DataEnd CRC are not validated.

    RangeReader::channels

    fn RangeReader::channels(self : RangeReader) -> Array[Channel]

    RangeReader::clear_cache

    fn RangeReader::clear_cache(self : RangeReader) -> Unit

    RangeReader::cursor

    fn RangeReader::cursor(self : RangeReader, query : Query, pending_bytes? : Int, span_bytes? : Int) -> FileCursor raise McapError

    RangeReader::declaration_log

    fn RangeReader::declaration_log(self : RangeReader) -> Log

    RangeReader::diagnostics

    fn RangeReader::diagnostics(self : RangeReader) -> ReadDiagnostics

    RangeReader::plan_field_query

    fn RangeReader::plan_field_query(self : RangeReader, index : FieldIndex, filter : JsonFilter, fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, decoder? : PayloadDecoder) -> FieldQueryPlan raise McapError

    Caller must use the same decoder semantics identified when building the index.

    RangeReader::query

    fn RangeReader::query(self : RangeReader, query : Query) -> Array[Message] raise McapError

    RangeReader::query_source

    fn RangeReader::query_source(self : RangeReader) -> QuerySource raise McapError

    RangeReader::validate_all

    fn RangeReader::validate_all(self : RangeReader) -> Unit raise McapError

    Fully load and validate this container within fallback_bytes and limits. Unlike indexed queries this checks unread data too; it can reject a file that an earlier selective query could read successfully. An absent CRC is not an independently verified checksum. Use scan_source for bounded-record scanning when the full encoded file exceeds the load budget.

    RangeRecord

    type RangeRecord

    ReadDiagnostics

    pub(all) struct ReadDiagnostics {
    read_calls : Int
    bytes_read : UInt64
    decoded_chunks : Int
    cache_hits : Int
    cache_bytes : Int
    peak_cache_bytes : Int
    indexed : Bool
    full_validation : Bool
    } derive(Eq,
    Debug
    )

    ReadDiagnostics::equal

    ReadDiagnostics::not_equal

    fn ReadDiagnostics::not_equal(x : ReadDiagnostics, y : ReadDiagnostics) -> Bool

    ReadSource

    pub struct ReadSource {
    size : UInt64
    read_at : (UInt64, Int) -> Bytes raise McapError
    calls : Int
    bytes_read : UInt64
    }

    The callback may short-read, but must return bytes from a stable source.

    ReadSource::read_exact

    fn ReadSource::read_exact(self : ReadSource, offset : UInt64, length : Int) -> Bytes raise McapError

    Retry short reads, rejecting zero progress, over-reads and out-of-bounds spans.

    ReadSource::size

    fn ReadSource::size(self : ReadSource) -> UInt64

    ReadSpan

    pub(all) struct ReadSpan {
    offset : UInt64
    length : Int
    } derive(Eq,
    Debug
    )

    ReadSpan::equal

    fn ReadSpan::equal(ReadSpan, ReadSpan) -> Bool

    ReadSpan::not_equal

    fn ReadSpan::not_equal(x : ReadSpan, y : ReadSpan) -> Bool

    ReadSpan::to_repr

    Record

    pub(all) struct Record {
    opcode : Byte
    offset : Int
    body : Bytes
    } derive(Eq,
    Debug
    )

    Record::equal

    fn Record::equal(Record, Record) -> Bool

    Record::not_equal

    fn Record::not_equal(x : Record, y : Record) -> Bool

    Record::to_repr

    RecordingOptions

    pub(all) struct RecordingOptions {
    stream : StreamOptions
    segment_messages : Int
    segment_bytes_target : UInt64
    segment_span : UInt64
    segment_limit : Int
    sequences : SequencePolicy
    source_identity : String
    } derive(Eq,
    Debug
    )

    RecordingOptions::equal

    RecordingOptions::not_equal

    fn RecordingOptions::not_equal(x : RecordingOptions, y : RecordingOptions) -> Bool

    RecordingSession

    pub struct RecordingSession {
    template : Log
    config : Json
    options : RecordingOptions
    storage : RecordingStorage
    completed : Array[Json]
    next_ordinal : Int
    active : Int?
    writer : StreamWriter?
    next_sequence : Map[Int, UInt64]
    committed_next : Map[Int, UInt64]
    total : UInt64
    start_time : UInt64
    end_time : UInt64
    state : WriterState
    adopted : Int
    quarantined : Int
    }

    RecordingSession::append

    fn RecordingSession::append(self : RecordingSession, message : Message) -> Unit raise McapError

    RecordingSession::cancel

    fn RecordingSession::cancel(self : RecordingSession) -> Unit

    Leaves a reserved, possibly incomplete tail for inspection on reopen.

    RecordingSession::committed_messages

    fn RecordingSession::committed_messages(self : RecordingSession) -> UInt64

    RecordingSession::finish

    fn RecordingSession::finish(self : RecordingSession) -> Json raise McapError

    RecordingSession::info

    RecordingStorage

    pub struct RecordingStorage {
    create : (Int) -> WriteSink raise McapError
    open : (Int) -> ReadSource raise McapError
    exists : (Int) -> Bool raise McapError
    seal : (Int) -> Unit raise McapError
    save : (Bytes) -> Unit raise McapError
    quarantine : (Int) -> Unit raise McapError
    list : () -> Array[Int] raise McapError
    fingerprint : (ReadSource) -> String raise McapError
    }

    save/seal must return only after their durable atomic publication. create owns a new empty segment; quarantine preserves its bytes outside the set.

    RecordingTail

    pub struct RecordingTail {
    identity : String
    config : Json?
    accepted : Array[Json]
    }

    RecordingTail::poll

    fn RecordingTail::poll(self : RecordingTail, manifest : Bytes, open : (Int) -> ReadSource raise McapError, fingerprint : (ReadSource) -> String raise McapError, batch_bytes? : Int) -> LiveBatch? raise McapError

    One complete, manifest-committed segment per poll; ignores active .part data. The open callback must provide immutable published segment snapshots.

    RecordingTail::snapshot

    fn RecordingTail::snapshot(self : RecordingTail) -> Bytes raise McapError

    RecoveredBlock

    pub(all) struct RecoveredBlock {
    start : UInt64
    end : UInt64
    messages : Int
    } derive(Eq,
    Debug
    )

    RecoveredBlock::equal

    RecoveredBlock::not_equal

    fn RecoveredBlock::not_equal(x : RecoveredBlock, y : RecoveredBlock) -> Bool

    RecoveryReport

    pub(all) struct RecoveryReport {
    log : Log
    recovered_records : Int
    stop_offset : Int
    complete : Bool
    reason : String
    }

    Replay

    pub struct Replay {
    source : QuerySource
    query : Query
    budget : Int
    stream : MessageStream
    pending : Message?
    state : ReplayState
    position : UInt64
    wall : UInt64
    last_clock : UInt64?
    numerator : Int
    denominator : Int
    emitted : Int
    generation : Int
    previous : UInt64?
    }

    Replay::cancel

    fn Replay::cancel(self : Replay) -> Unit

    Replay::pause

    fn Replay::pause(self : Replay, now : UInt64) -> Unit raise McapError

    Replay::poll

    fn Replay::poll(self : Replay, now : UInt64) -> ReplayPoll raise McapError

    Replay::progress

    fn Replay::progress(self : Replay, now : UInt64) -> ReplayProgress raise McapError

    Replay::resume_playback

    #alias(resume)
    fn Replay::resume_playback(self : Replay, now : UInt64) -> Unit raise McapError

    Replay::seek

    fn Replay::seek(self : Replay, time : UInt64, now : UInt64) -> Unit raise McapError

    Replay::set_rate

    fn Replay::set_rate(self : Replay, numerator : Int, denominator : Int, now : UInt64) -> Unit raise McapError

    Replay::step

    fn Replay::step(self : Replay, now : UInt64) -> Message? raise McapError

    ReplayPoll

    pub(all) enum ReplayPoll {
    ReplayWait(UInt64)
    ReplayIdle
    ReplayEvent(Message)
    ReplayEnd
    }

    ReplayProgress

    pub(all) struct ReplayProgress {
    state : ReplayState
    position : UInt64
    emitted : Int
    rate_numerator : Int
    rate_denominator : Int
    generation : Int
    }

    ReplayState

    pub(all) enum ReplayState {
    ReplayReady
    ReplayRunning
    ReplayPaused
    ReplayDone
    ReplayCancelled
    ReplayFailed
    } derive(Eq,
    Debug
    )

    ReplayState::equal

    fn ReplayState::equal(ReplayState, ReplayState) -> Bool

    ReplayState::not_equal

    fn ReplayState::not_equal(x : ReplayState, y : ReplayState) -> Bool

    Ros1Decoder

    pub struct Ros1Decoder {
    layout : CdrDecoder
    }

    Ros1Decoder::decode

    fn Ros1Decoder::decode(self : Ros1Decoder, bytes : Bytes) -> Json raise McapError

    Ros1Decoder::encode

    fn Ros1Decoder::encode(self : Ros1Decoder, value : Json) -> Bytes raise McapError

    Ros1Decoder::view

    fn Ros1Decoder::view(self : Ros1Decoder, bytes : Bytes, selection? : DecodeSelection) -> PayloadView raise McapError

    RunHead

    type RunHead

    RunInput

    type RunInput

    Schema

    pub(all) struct Schema {
    id : Int
    name : String
    encoding : String
    data : Bytes
    } derive(Eq,
    Debug
    )

    Schema::equal

    fn Schema::equal(Schema, Schema) -> Bool

    Schema::not_equal

    fn Schema::not_equal(x : Schema, y : Schema) -> Bool

    Schema::to_repr

    SchemaComparison

    type SchemaComparison

    SchemaDecoder

    type SchemaDecoder

    SequencePolicy

    pub(all) enum SequencePolicy {
    PreserveSequence
    ContinueSequence
    } derive(Eq,
    Debug
    )

    SequencePolicy::equal

    SequencePolicy::not_equal

    fn SequencePolicy::not_equal(x : SequencePolicy, y : SequencePolicy) -> Bool

    SidecarCursor

    pub struct SidecarCursor {
    reader : SidecarReader
    original : Query
    allowed : Map[Int, Bool]
    query : Query
    state : FileCursorState
    position : Int
    remaining : Int
    offset_left : Int
    emitted : Int
    skipped : Int
    waiting : ReadSpan?
    ready : Message?
    }

    SidecarCursor::cancel

    fn SidecarCursor::cancel(self : SidecarCursor) -> Unit

    SidecarCursor::feed

    fn SidecarCursor::feed(self : SidecarCursor, bytes : Bytes) -> Unit raise McapError

    SidecarCursor::next

    fn SidecarCursor::next(self : SidecarCursor) -> Message? raise McapError

    SidecarCursor::next_page

    fn SidecarCursor::next_page(self : SidecarCursor, size : Int) -> Array[Message] raise McapError

    SidecarCursor::pending_bytes

    fn SidecarCursor::pending_bytes(self : SidecarCursor) -> Int

    SidecarCursor::poll

    fn SidecarCursor::poll(self : SidecarCursor) -> FilePoll raise McapError

    SidecarCursor::progress

    fn SidecarCursor::progress(self : SidecarCursor) -> Json

    SidecarCursor::seek

    fn SidecarCursor::seek(self : SidecarCursor, time : UInt64) -> Unit raise McapError

    SidecarCursor::write_ndjson

    fn SidecarCursor::write_ndjson(self : SidecarCursor, sink : WriteSink) -> Int raise McapError

    SidecarEntry

    type SidecarEntry

    SidecarReader

    pub struct SidecarReader {
    source : ReadSource
    declarations : Log
    entries : Array[SidecarEntry]
    positions : Array[Int]
    limits : Limits
    digest : String
    content_verified : Bool
    index_bytes : Int
    cache_budget : Int
    cached_offset : UInt64?
    cached_span : Int
    cached : Chunk?
    cached_bytes : Int
    }

    SidecarReader::channels

    fn SidecarReader::channels(self : SidecarReader) -> Array[Channel]

    SidecarReader::clear_cache

    fn SidecarReader::clear_cache(self : SidecarReader) -> Unit

    SidecarReader::cursor

    fn SidecarReader::cursor(self : SidecarReader, query : Query) -> SidecarCursor raise McapError

    SidecarReader::declaration_log

    fn SidecarReader::declaration_log(self : SidecarReader) -> Log

    SidecarReader::info

    fn SidecarReader::info(self : SidecarReader) -> Json

    SidecarReader::query_source

    fn SidecarReader::query_source(self : SidecarReader) -> QuerySource raise McapError

    SidecarReader::validate_entries

    fn SidecarReader::validate_entries(self : SidecarReader) -> Unit raise McapError

    SkippedBlock

    pub(all) struct SkippedBlock {
    start : UInt64
    end : UInt64
    reason : String
    } derive(Eq,
    Debug
    )

    SkippedBlock::equal

    SkippedBlock::not_equal

    fn SkippedBlock::not_equal(x : SkippedBlock, y : SkippedBlock) -> Bool

    SortRow

    type SortRow

    SortSession

    type SortSession

    SortStorage

    pub struct SortStorage {
    create : (Int) -> WriteSink raise McapError
    open : (Int) -> ReadSource raise McapError
    remove : (Int) -> Unit raise McapError
    finish : () -> Unit raise McapError
    }

    SourceScanEvent

    pub(all) enum SourceScanEvent {
    RecordStart(UInt64)
    RecordRead(UInt64, Byte, Int)
    RecordAccepted(UInt64, Byte, Int)
    DataChecksum(UInt64, UInt, UInt)
    DataValidated(UInt64, Bool)
    SummaryStart(UInt64)
    }

    Physical scan evidence. Accepted records can still fail the final data CRC.

    SourceTables

    type SourceTables

    SourceVisitor

    pub(all) struct SourceVisitor {
    schema : (Schema) -> Unit raise McapError
    channel : (Channel) -> Unit raise McapError
    message : (Message, MessageLocation) -> Unit raise McapError
    attachment : (Attachment) -> Unit raise McapError
    metadata : (Metadata) -> Unit raise McapError
    }

    StreamDecoder

    pub struct StreamDecoder {
    limits : Limits
    pending :
    Buffer

    expected : Int
    offset : Int
    count : Int
    failed : Bool
    finished : Bool
    }

    Incremental record framing. File magic/envelope checks belong to scan_file.

    StreamDecoder::buffered_bytes

    fn StreamDecoder::buffered_bytes(self : StreamDecoder) -> Int

    StreamDecoder::feed

    fn StreamDecoder::feed(self : StreamDecoder, bytes : Bytes) -> Array[Record] raise McapError

    StreamDecoder::finish

    fn StreamDecoder::finish(self : StreamDecoder) -> Unit raise McapError

    StreamDecoder::new

    fn StreamDecoder::new(limits? : Limits, base? : Int) -> StreamDecoder raise McapError

    StreamDecoder::record_count

    fn StreamDecoder::record_count(self : StreamDecoder) -> Int

    StreamOptions

    pub(all) struct StreamOptions {
    compression : Compression
    chunk_bytes : Int
    chunk_messages : Int
    chunk_span : UInt64
    summary_bytes : Int
    } derive(Eq,
    Debug
    )

    StreamOptions::equal

    StreamOptions::not_equal

    fn StreamOptions::not_equal(x : StreamOptions, y : StreamOptions) -> Bool

    StreamWriter

    pub struct StreamWriter {
    sink : WriteSink
    options : StreamOptions
    limits : Limits
    declarations : Log
    pending : Array[Record]
    summary : Array[(Byte, Bytes)]
    counts : Map[Int, UInt64]
    state : WriterState
    crc : UInt
    records : Int
    buffered : Int
    peak_buffered : Int
    retained : Int
    messages : UInt64
    chunks : UInt
    attachments : UInt
    metadata : UInt
    start_time : UInt64
    end_time : UInt64
    chunk_start : UInt64
    chunk_end : UInt64
    }

    StreamWriter::add_attachment

    fn StreamWriter::add_attachment(self : StreamWriter, value : Attachment) -> Unit raise McapError

    StreamWriter::add_channel

    fn StreamWriter::add_channel(self : StreamWriter, channel : Channel) -> Unit raise McapError

    StreamWriter::add_metadata

    fn StreamWriter::add_metadata(self : StreamWriter, value : Metadata) -> Unit raise McapError

    StreamWriter::add_schema

    fn StreamWriter::add_schema(self : StreamWriter, schema : Schema) -> Unit raise McapError

    StreamWriter::append

    fn StreamWriter::append(self : StreamWriter, message : Message) -> Unit raise McapError

    StreamWriter::cancel

    fn StreamWriter::cancel(self : StreamWriter) -> Unit

    Leaves an unfinished output prefix; does not fabricate a successful footer.

    StreamWriter::finish

    fn StreamWriter::finish(self : StreamWriter) -> WriteProgress raise McapError

    StreamWriter::flush

    fn StreamWriter::flush(self : StreamWriter) -> Unit raise McapError

    Manual flush; automatic flush also occurs before byte/count/time thresholds.

    StreamWriter::progress

    fn StreamWriter::progress(self : StreamWriter) -> WriteProgress

    SummaryOffset

    pub(all) struct SummaryOffset {
    opcode : Byte
    start : UInt64
    length : UInt64
    }

    SyncCell

    pub(all) struct SyncCell {
    name : String
    synthetic : Bool
    message : Message?
    before : Message?
    after : Message?
    source_time : UInt64?
    before_time : UInt64?
    after_time : UInt64?
    distance : UInt64?
    interpolated : Json?
    }

    SyncClock

    pub(all) enum SyncClock {
    SyncLogTime
    SyncPublishTime
    SyncJsonNanoseconds(String)
    SyncJsonStamp(String, String)
    }

    SyncInput

    pub struct SyncInput {
    name : String
    stream : MessageStream
    clock : (Message) -> UInt64 raise McapError
    interpolation_paths : Array[String]?
    synthetic : Bool
    }

    SyncLane

    type SyncLane

    SyncMode

    pub(all) enum SyncMode {
    SyncNearest
    SyncPrevious
    SyncNext
    SyncLinear
    } derive(Eq)

    SyncMode::equal

    fn SyncMode::equal(SyncMode, SyncMode) -> Bool

    SyncMode::not_equal

    fn SyncMode::not_equal(x : SyncMode, y : SyncMode) -> Bool

    SyncOptions

    pub(all) struct SyncOptions {
    mode : SyncMode
    reuse : SyncReuse
    tolerance : UInt64
    keep_missing : Bool
    interpolation_paths : Array[String]
    buffer_bytes : Int
    json_bytes : Int
    output_rows : UInt64
    input_messages : UInt64
    }

    SyncReuse

    pub(all) enum SyncReuse {
    SyncAllowReuse
    SyncConsume
    } derive(Eq)

    SyncReuse::equal

    fn SyncReuse::equal(SyncReuse, SyncReuse) -> Bool

    SyncReuse::not_equal

    fn SyncReuse::not_equal(x : SyncReuse, y : SyncReuse) -> Bool

    SyncRow

    pub(all) struct SyncRow {
    time : UInt64
    cells : Array[SyncCell]
    }

    SyncStream

    pub struct SyncStream {
    lanes : Array[SyncLane]
    options : SyncOptions
    cancelled : () -> Bool
    state : FileCursorState
    read : UInt64
    examined : UInt64
    emitted : UInt64
    missing : UInt64
    peak_bytes : Int
    anchor : TimedSyncMessage?
    }

    SyncStream::cancel

    fn SyncStream::cancel(self : SyncStream) -> Unit

    SyncStream::info

    fn SyncStream::info(self : SyncStream) -> Json

    SyncStream::next

    fn SyncStream::next(self : SyncStream) -> SyncRow? raise McapError

    TemporalJoinCursor

    pub struct TemporalJoinCursor {
    options : JoinOptions
    left : Message?
    before : Message?
    after : Message?
    left_done : Bool
    right_done : Bool
    waiting : Int
    last_left : UInt64?
    last_right : UInt64?
    state : FileCursorState
    left_read : UInt64
    right_read : UInt64
    matched : UInt64
    unmatched : UInt64
    peak_bytes : Int
    }

    TemporalJoinCursor::cancel

    fn TemporalJoinCursor::cancel(self : TemporalJoinCursor) -> Unit

    TemporalJoinCursor::feed_left

    fn TemporalJoinCursor::feed_left(self : TemporalJoinCursor, message : Message?) -> Unit raise McapError

    TemporalJoinCursor::feed_right

    fn TemporalJoinCursor::feed_right(self : TemporalJoinCursor, message : Message?) -> Unit raise McapError

    TemporalJoinCursor::info

    TemporalJoinCursor::poll

    Ascending many-to-one left join. Equal-distance ties prefer the earlier timestamp; duplicate right timestamps prefer the first stable input record.

    TemporalJoinStream

    pub struct TemporalJoinStream {
    cursor : TemporalJoinCursor
    left : MessageStream
    right : MessageStream
    closed : Bool
    }

    TemporalJoinStream::cancel

    fn TemporalJoinStream::cancel(self : TemporalJoinStream) -> Unit

    TemporalJoinStream::info

    TemporalJoinStream::next

    TemporalMatch

    pub(all) struct TemporalMatch {
    left : Message
    right : Message?
    distance : UInt64?
    right_is_earlier : Bool
    } derive(Eq,
    Debug
    )

    TemporalMatch::equal

    TemporalMatch::not_equal

    fn TemporalMatch::not_equal(x : TemporalMatch, y : TemporalMatch) -> Bool

    TemporaryWorkspace

    type TemporaryWorkspace

    TfEdge

    type TfEdge

    TfLookup

    pub(all) struct TfLookup {
    transform : TfTransform
    evidence : Array[TfStamped]
    interpolated : Bool
    }

    TfQuaternion

    pub(all) struct TfQuaternion {
    x : Double
    y : Double
    z : Double
    w : Double
    } derive(Eq,
    Debug
    )

    TfQuaternion::equal

    TfQuaternion::not_equal

    fn TfQuaternion::not_equal(x : TfQuaternion, y : TfQuaternion) -> Bool

    TfStamped

    pub(all) struct TfStamped {
    parent : String
    child : String
    time : UInt64
    transform : TfTransform
    is_static : Bool
    origin : Message?
    }

    TfTransform

    pub(all) struct TfTransform {
    translation : TfVector
    rotation : TfQuaternion
    } derive(Eq,
    Debug
    )

    TfTransform::equal

    fn TfTransform::equal(TfTransform, TfTransform) -> Bool

    TfTransform::not_equal

    fn TfTransform::not_equal(x : TfTransform, y : TfTransform) -> Bool

    TfTree

    pub struct TfTree {
    edges : Map[String, TfEdge]
    sample_limit : Int
    byte_limit : Int
    count : Int
    bytes : Int
    }

    TfTree::add

    fn TfTree::add(self : TfTree, sample : TfStamped) -> Unit raise McapError

    Each insertion is atomic. Parent changes and static/dynamic conflicts require an explicitly separate tree/session instead of silently changing topology.

    TfTree::context

    fn TfTree::context(self : TfTree, frames : Array[String], start : UInt64, end : UInt64) -> Array[TfStamped] raise McapError

    Retains static state and dynamic brackets plus all interior updates on the ancestor paths of explicitly requested frames. Whole origin messages may contain additional transforms; callers must not invent new source envelopes.

    TfTree::lookup

    fn TfTree::lookup(self : TfTree, target : String, source : String, time : UInt64, interpolate? : Bool, max_gap? : UInt64) -> TfLookup raise McapError

    Returns target_T_source. Dynamic edges never extrapolate.

    TfVector

    pub(all) struct TfVector {
    x : Double
    y : Double
    z : Double
    } derive(Eq,
    Debug
    )

    TfVector::equal

    fn TfVector::equal(TfVector, TfVector) -> Bool

    TfVector::not_equal

    fn TfVector::not_equal(x : TfVector, y : TfVector) -> Bool

    TfVector::to_repr

    TimedSyncMessage

    type TimedSyncMessage

    TopicStats

    pub(all) struct TopicStats {
    channel_id : Int
    topic : String
    message_count : Int
    payload_bytes : UInt64
    first_time : UInt64?
    last_time : UInt64?
    maximum_gap : UInt64
    median_gap : UInt64
    p95_gap : UInt64
    arrival_regressions : Int
    sequence_discontinuities : Int
    publish_after_log : Int
    frequency_hz : Double
    }

    TransformOptions

    pub(all) struct TransformOptions {
    query : Query
    topic_map : Array[(String, String)]
    sample_period : UInt64
    sample_origin : UInt64
    align_start : UInt64?
    attachment_names : Array[String]
    attachment_media_types : Array[String]
    attachment_start : UInt64
    attachment_end : UInt64
    metadata_names : Array[String]
    metadata_entries : Array[(String, String)]
    }

    TransformReport

    pub(all) struct TransformReport {
    input_messages : UInt64
    sampled_messages : Int
    output_messages : Int
    output_bytes : UInt64
    peak_temporary_bytes : UInt64
    }

    TriggerOptions

    pub(all) struct TriggerOptions {
    pre : UInt64
    post : UInt64
    buffer_bytes : Int
    buffer_messages : Int
    clip_bytes : Int
    clip_messages : Int
    event_limit : Int
    }

    TriggerRecorder

    pub struct TriggerRecorder {
    template : Log
    options : TriggerOptions
    emit : (Log, Json) -> Unit raise McapError
    ring : Array[Message?]
    head : Int
    buffered_bytes : Int
    first : UInt64?
    last : UInt64?
    capacity_evicted_through : UInt64?
    evicted : UInt64
    active : Array[Message]?
    active_bytes : Int
    start : UInt64
    deadline : UInt64
    pre_complete : Bool
    labels : Array[String]
    completed : Int
    state : WriterState
    delivering : Bool
    }

    TriggerRecorder::cancel

    fn TriggerRecorder::cancel(self : TriggerRecorder) -> Unit

    TriggerRecorder::feed

    fn TriggerRecorder::feed(self : TriggerRecorder, message : Message) -> Unit raise McapError

    TriggerRecorder::finish

    fn TriggerRecorder::finish(self : TriggerRecorder) -> Unit raise McapError

    TriggerRecorder::progress

    fn TriggerRecorder::progress(self : TriggerRecorder) -> Json

    TriggerRecorder::trigger

    fn TriggerRecorder::trigger(self : TriggerRecorder, label : String) -> Unit raise McapError

    Trigger at the latest fed message's log time. Repeated triggers extend a single window; output count and label count are independently bounded.

    WriteProgress

    pub(all) struct WriteProgress {
    state : WriterState
    bytes_written : UInt64
    messages : UInt64
    chunks : UInt
    buffered_bytes : Int
    peak_buffered_bytes : Int
    retained_summary_bytes : Int
    } derive(Eq,
    Debug
    )

    WriteProgress::equal

    WriteProgress::not_equal

    fn WriteProgress::not_equal(x : WriteProgress, y : WriteProgress) -> Bool

    WriteSink

    pub struct WriteSink {
    write_all : (Bytes) -> Unit raise McapError
    position : UInt64
    }

    WriteSink::position

    fn WriteSink::position(self : WriteSink) -> UInt64

    WriteSink::write

    fn WriteSink::write(self : WriteSink, bytes : Bytes) -> Unit raise McapError

    Write raw bytes to an exclusively owned sink (for temporary run storage).

    WriterState

    pub(all) enum WriterState {
    WriterOpen
    WriterFinished
    WriterFailed
    WriterCancelled
    } derive(Eq,
    Debug
    )

    WriterState::equal

    fn WriterState::equal(WriterState, WriterState) -> Bool

    WriterState::not_equal

    fn WriterState::not_equal(x : WriterState, y : WriterState) -> Bool

    aggregate_external

    fn aggregate_external(cursor : DatasetCursor, channels : Array[Channel], storage : SortStorage, output : WriteSink, aggregate? : AggregateOptions, external? : ExternalOptions, cancelled? : () -> Bool) -> Json raise McapError

    Stream one exact aggregate JSON object per group; failures leave provisional output. Temporary storage is dedicated and always cleaned on return.

    aggregate_json

    fn aggregate_json(cursor : DatasetCursor, channels : Array[Channel], options? : AggregateOptions) -> Json raise McapError

    Consume ordered messages without retaining history; returns deterministic, bounded groups. Payload JSON is capped at 1 MiB/64 levels.

    aggregate_options

    fn aggregate_options() -> AggregateOptions

    all_query

    fn all_query() -> Query

    artifact_batch_storage

    fn artifact_batch_storage(load : () -> Bytes? raise McapError, save : (Bytes) -> Unit raise McapError, create : (Int) -> WriteSink raise McapError, seal : (Int) -> Unit raise McapError, digest : (Int) -> String raise McapError, publish : (Int) -> Unit raise McapError, published : (Int) -> Bool raise McapError, discard : (Int) -> Unit raise McapError, inventory : () -> Array[Int] raise McapError) -> ArtifactBatchStorage

    block_recovery_json

    fn block_recovery_json(report : BlockRecoveryReport) -> Json

    build_disk_sidecar

    fn build_disk_sidecar(source : ReadSource, storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, identity? : String, page_entries? : Int, options? : ExternalOptions, cancelled? : () -> Bool) -> Json raise McapError

    Write MIDX2 pages using external sorting. Storage is dedicated to this job. Output is provisional until success; caller owns atomic publication.

    build_field_index

    fn build_field_index(source : ReadSource, paths : Array[String], fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, decoder? : PayloadDecoder, limits? : Limits, max_zones? : Int, state_bytes? : Int, cancelled? : () -> Bool) -> FieldIndex raise McapError

    build_paged_field_index

    fn build_paged_field_index(source : ReadSource, sink : WriteSink, paths : Array[String], fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, page_bytes? : Int, page_zones? : Int, bloom? : Bool, limits? : Limits, cancelled? : () -> Bool) -> Json raise McapError

    Streaming physical-order build: one region and one fixed-size page in memory. Output must be staged by the caller, since source validation finishes last.

    build_query_index

    fn build_query_index(log : Log) -> QueryIndex raise McapError

    build_sidecar

    fn build_sidecar(source : ReadSource, fingerprint : (ReadSource) -> String raise McapError, identity? : String, limits? : Limits, index_bytes? : Int, declaration_bytes? : Int, cancelled? : () -> Bool) -> Bytes raise McapError

    calibrate_log

    fn calibrate_log(log : Log, mapping : ClockMap, same_publish_clock? : Bool) -> Log raise McapError

    Rewrite all log clocks, optionally publish/create clocks only when the caller asserts the same clock domain. Payload timestamps are deliberately untouched.

    cdr_decoder

    fn cdr_decoder(name : String, definition : Bytes, options? : CdrOptions) -> CdrDecoder raise McapError

    cdr_options

    fn cdr_options() -> CdrOptions

    check_match_quality

    fn check_match_quality(left : MessageStream, right : MessageStream, tolerance : UInt64, minimum_basis_points : Int) -> Json raise McapError

    Match availability over two ascending streams, retaining the existing join's bounded state. Basis points use integer arithmetic and include unmatched rows.

    check_quality

    fn check_quality(source : QuerySource, rules : Array[QualityRule], start : UInt64, end : UInt64, detail_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> Json raise McapError

    Evaluate the entire explicit closed interval, without query pagination. Gap checks include leading/trailing silence. Sequence checks are per channel.

    checkpoint_progress

    fn checkpoint_progress(bytes : Bytes) -> Json raise McapError

    checkpoint_run_ids

    fn checkpoint_run_ids(bytes : Bytes) -> Array[Int] raise McapError

    Read owned run IDs for a storage adapter's orphan cleanup. No path strings.

    clip_stream_options

    fn clip_stream_options() -> ClipStreamOptions

    clock_map

    fn clock_map(anchors : Array[ClockAnchor], extrapolate? : Bool) -> ClockMap raise McapError

    Monotone, piecewise affine map. Integer interpolation rounds down. Anchors are supplied by the caller, never inferred from unrelated sensor values.

    codec_worker_handler

    fn codec_worker_handler(input_bytes? : Int, output_bytes? : Int, context_bytes? : Int) -> ((String) -> String) raise McapError

    Bounded pure MoonBit handler for a trusted host worker entry.

    compare_payload_schemas

    fn compare_payload_schemas(old : Schema, new : Schema, issue_limit? : Int) -> Json raise McapError

    Conservative directional comparison of supported payload definitions. This describes wire/schema acceptance, not application meaning or unit equivalence.

    compress_payload

    fn compress_payload(bytes : Bytes, compression : Compression) -> Bytes

    compute_file_statistics

    fn compute_file_statistics(log : Log, chunk_count : UInt) -> FileStatistics

    context_rule

    fn context_rule(topic : String) -> ContextRule

    copy_clip_auxiliary

    fn copy_clip_auxiliary(source : ReadSource, writer : StreamWriter, attachment_names? : Array[String], metadata_names? : Array[String], limits? : Limits, cancelled? : () -> Bool) -> UInt64 raise McapError

    Copy all auxiliary records or explicit name allowlists. Message payloads are scanned for container validation but never retained as a Log.

    copy_log

    fn copy_log(log : Log) -> Log

    Copy mutable input bytes and arrays so later caller mutations do not stale the index.

    crc32

    fn crc32(bytes : Bytes) -> UInt

    IEEE CRC32, reflected polynomial, initial and final XOR 0xffffffff.

    crc32_extend

    fn crc32_extend(previous : UInt, bytes : Bytes) -> UInt

    Accepts a previously finalized CRC, allowing independent streaming blocks.

    dataset_message_json

    fn dataset_message_json(record : DatasetMessage, channels : Array[Channel]) -> Json

    decode_attachment

    fn decode_attachment(bytes : Bytes, limits? : Limits) -> Attachment raise McapError

    decode_attachment_index

    fn decode_attachment_index(bytes : Bytes, limits? : Limits) -> AttachmentIndex raise McapError

    decode_channel

    fn decode_channel(bytes : Bytes, limits? : Limits) -> Channel raise McapError

    decode_chunk

    fn decode_chunk(bytes : Bytes, limits? : Limits) -> Chunk raise McapError

    decode_chunk_index

    fn decode_chunk_index(bytes : Bytes, limits? : Limits) -> ChunkIndex raise McapError

    decode_file_statistics

    fn decode_file_statistics(bytes : Bytes, limits? : Limits) -> FileStatistics raise McapError

    fn decode_footer(bytes : Bytes) -> Footer raise McapError

    decode_header

    fn decode_header(bytes : Bytes, limits? : Limits) -> Header raise McapError

    decode_hex

    fn decode_hex(value : String, max_bytes? : Int) -> Bytes raise McapError

    decode_message

    fn decode_message(bytes : Bytes, limits? : Limits) -> Message raise McapError

    decode_message_index

    fn decode_message_index(bytes : Bytes, limits? : Limits) -> MessageIndex raise McapError

    decode_metadata

    fn decode_metadata(bytes : Bytes, limits? : Limits) -> Metadata raise McapError

    decode_metadata_index

    fn decode_metadata_index(bytes : Bytes, limits? : Limits) -> MetadataIndex raise McapError

    decode_records

    fn decode_records(bytes : Bytes, limits? : Limits, base? : Int) -> Array[Record] raise McapError

    decode_schema

    fn decode_schema(bytes : Bytes, limits? : Limits) -> Schema raise McapError

    decode_selection

    fn decode_selection() -> DecodeSelection

    decode_summary_offset

    fn decode_summary_offset(bytes : Bytes) -> SummaryOffset raise McapError

    decompress_payload

    fn decompress_payload(bytes : Bytes, compression : String, expected_size : UInt64, limits? : Limits) -> Bytes raise McapError

    default_limits

    fn default_limits() -> Limits

    detect_events

    fn detect_events(source : QuerySource, rule : EventRule, start? : UInt64, end? : UInt64, event_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> Array[EventSpan] raise McapError

    diagnose_file

    fn diagnose_file(bytes : Bytes, limits? : Limits) -> FileDiagnosis

    Full validation; precise offsets are supplied only when directly known.

    diagnose_source

    fn diagnose_source(source : ReadSource, limits? : Limits, summary_bytes? : Int, read_bytes? : Int, cancelled? : () -> Bool) -> Json raise McapError

    Strict bounded-record validation. Stops at the first failure; prefix parsing is not a proof of whole-file integrity. Metadata is validated before data.

    diagnosis_json

    fn diagnosis_json(report : FileDiagnosis) -> Json

    diff_options

    fn diff_options() -> DiffOptions

    diff_sources

    fn diff_sources(left : ReadSource, right : ReadSource, options? : DiffOptions) -> Json raise McapError

    Compare validated sources by exact timestamp buckets and message multisets. Ignores compression, physical ID values, indexes and Header.library.

    edit_payload_json

    fn edit_payload_json(document : Json, edits : Array[PayloadEdit]) -> Json raise McapError

    empty_log

    fn empty_log(profile? : String) -> Log

    encode_attachment

    fn encode_attachment(value : Attachment, checksums? : Bool) -> Bytes

    encode_attachment_index

    fn encode_attachment_index(value : AttachmentIndex) -> Bytes

    encode_channel

    fn encode_channel(value : Channel) -> Bytes raise McapError

    encode_chunk

    fn encode_chunk(records : Array[Record], start_time : UInt64, end_time : UInt64, checksums? : Bool, compression? : Compression) -> Bytes raise McapError

    encode_chunk_index

    fn encode_chunk_index(value : ChunkIndex) -> Bytes raise McapError

    encode_file_statistics

    fn encode_file_statistics(value : FileStatistics) -> Bytes raise McapError

    fn encode_footer(value : Footer) -> Bytes

    encode_header

    fn encode_header(value : Header) -> Bytes

    encode_hex

    fn encode_hex(bytes : Bytes) -> String

    Portable hexadecimal transport for binary fixtures and command output.

    encode_message

    fn encode_message(value : Message) -> Bytes raise McapError

    encode_message_index

    fn encode_message_index(value : MessageIndex) -> Bytes raise McapError

    encode_metadata

    fn encode_metadata(value : Metadata) -> Bytes raise McapError

    encode_metadata_index

    fn encode_metadata_index(value : MetadataIndex) -> Bytes

    encode_schema

    fn encode_schema(value : Schema) -> Bytes raise McapError

    encode_summary_offset

    fn encode_summary_offset(value : SummaryOffset) -> Bytes

    event_detector

    fn event_detector(rule : EventRule) -> EventDetector raise McapError

    event_rule

    fn event_rule(topic : String, enter : String) -> EventRule

    event_span_json

    fn event_span_json(event : EventSpan) -> Json

    event_windows

    fn event_windows(events : Array[EventSpan], pre : UInt64, post : UInt64, merge_gap? : UInt64) -> Array[EventWindow] raise McapError

    Overlapping/nearby closed windows merge; event evidence remains separate.

    expand_worker_chunk

    fn expand_worker_chunk(body : Bytes, limits? : Limits) -> Bytes raise McapError

    Pure MoonBit work unit: bounded decompression and CRC, preserving raw records.

    external_merge

    fn external_merge(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, options? : ExternalOptions, cancelled? : () -> Bool, preserve_ids? : Bool) -> ExternalReport raise McapError

    Stable external sorting of full MCAP inputs; temporary storage is caller-selected.

    external_options

    fn external_options() -> ExternalOptions

    external_report_json

    fn external_report_json(report : ExternalReport) -> Json

    extract_context_clip

    fn extract_context_clip(source : QuerySource, start : UInt64, end : UInt64, topics? : Array[String], context? : Array[ContextRule], message_limit? : Int, byte_limit? : Int, pending_bytes? : Int, cancelled? : () -> Bool) -> ContextClip raise McapError

    Export a bounded, independent message clip. Explicit context rules select the last N messages per topic (not semantic state merging). Aux data is not fetched by QuerySource; the manifest states this instead of implying retention.

    find_attachments

    fn find_attachments(log : Log, name? : String, media_type? : String) -> Array[Attachment]

    frame

    fn frame(opcode : Byte, body : Bytes) -> Bytes raise McapError

    growing_tail

    fn growing_tail(identity : String, fingerprint : (ReadSource) -> String raise McapError, snapshot? : Bytes, limits? : Limits, batch_bytes? : Int) -> GrowingTail raise McapError

    inspect_json

    fn inspect_json(log : Log) -> Json raise McapError

    inspect_recording_manifest

    fn inspect_recording_manifest(bytes : Bytes) -> Json raise McapError

    io_error

    fn io_error(message : String) -> McapError

    Build an error for host adapters without exposing internal error constructors.

    join_options

    fn join_options() -> JoinOptions

    json_filter

    fn json_filter(expression : String, select? : Array[String], invalid? : JsonInvalidPolicy, max_bytes? : Int, max_depth? : Int) -> JsonFilter raise McapError

    json_query_record

    fn json_query_record(record : DatasetMessage, channels : Array[Channel], filter : JsonFilter) -> Json raise McapError

    live_quality

    fn live_quality(rules : Array[QualityRule], start : UInt64, lateness? : UInt64, pending_limit? : Int, snapshot? : Bytes) -> LiveQuality raise McapError

    magic

    fn magic() -> Bytes

    memory_source

    fn memory_source(bytes : Bytes) -> ReadSource

    merge_logs

    fn merge_logs(logs : Array[Log], chronological? : Bool) -> Log raise McapError

    Deduplicate declarations by content, not source-local identifiers.

    message_stream

    fn message_stream(next : () -> Message? raise McapError, cancel : () -> Unit, pending_bytes? : () -> Int) -> MessageStream

    message_timestamp

    fn message_timestamp(message : Message, clock : SyncClock, max_bytes? : Int) -> UInt64 raise McapError

    messages_csv

    fn messages_csv(messages : Array[Message], channels : Array[Channel]) -> String

    messages_json

    fn messages_json(messages : Array[Message], channels : Array[Channel]) -> Json

    new_builder

    fn new_builder(profile? : String, limits? : Limits) -> LogBuilder raise McapError

    new_read_source

    fn new_read_source(size : UInt64, read_at : (UInt64, Int) -> Bytes raise McapError) -> ReadSource

    new_stream_writer

    fn new_stream_writer(sink : WriteSink, profile? : String, options? : StreamOptions, limits? : Limits) -> StreamWriter raise McapError

    new_write_sink

    fn new_write_sink(write_all : (Bytes) -> Unit raise McapError) -> WriteSink

    Synchronous backpressure: callback must accept all bytes or raise.

    normalize_payload

    fn normalize_payload(document : Json, fields : Array[NormalizedField]) -> NormalizedPayload raise McapError

    Explicit projection/alias/default/type/unit rules; no implicit schema repair.

    normalized_field

    fn normalized_field(source : String, target : String) -> NormalizedField

    normalizing_decoder

    fn normalizing_decoder(decoder : PayloadDecoder, fields : Array[NormalizedField]) -> PayloadDecoder raise McapError

    Compose with QuerySource.decode_payload before filtering, joining or global pagination. Source declarations are adapted to JSON by that existing adapter.

    open_dataset

    fn open_dataset(sources : Array[QuerySource], limits? : Limits, declaration_bytes? : Int, max_sources? : Int) -> Dataset raise McapError

    open_disk_sidecar

    fn open_disk_sidecar(source : ReadSource, index : ReadSource, verification : IndexVerification, limits? : Limits, declaration_bytes? : Int, cache_pages? : Int, chunk_cache_bytes? : Int, index_bytes? : UInt64) -> DiskSidecarReader raise McapError

    open_field_index

    fn open_field_index(source : ReadSource, bytes : Bytes, fingerprint : (ReadSource) -> String raise McapError, decoder_identity : String, max_bytes? : Int, max_zones? : Int) -> FieldIndex raise McapError

    open_paged_field_header

    fn open_paged_field_header(source_size : UInt64, index_size : UInt64, bytes : Bytes, digest : String, decoder_identity : String) -> PagedFieldHeader raise McapError

    Header bytes consist of the 12-byte prefix followed by JSON and its CRC.

    open_reader

    fn open_reader(source : ReadSource, limits? : Limits, cache_bytes? : Int, summary_bytes? : Int, fallback_bytes? : Int) -> RangeReader raise McapError

    open_recording_session

    fn open_recording_session(template : Log, storage : RecordingStorage, manifest? : Bytes, options? : RecordingOptions) -> RecordingSession raise McapError

    open_sidecar

    fn open_sidecar(source : ReadSource, bytes : Bytes, verification : IndexVerification, limits? : Limits, index_bytes? : Int, cache_bytes? : Int) -> SidecarReader raise McapError

    parse_command

    fn parse_command(args : Array[String]) -> CommandOptions raise McapError

    Parse the general CLI without opening input, output or job paths. Time bounds are inclusive UInt64 nanoseconds. Query/slice default to at most 100000 messages. Unsupported option families are rejected rather than accepted as if they changed the output or enforced a resource limit.

    parse_decimal

    fn parse_decimal(text : String) -> UInt64 raise McapError

    Strict unsigned decimal parsing, preserving all UInt64 timestamp bits.

    parse_tf_message

    fn parse_tf_message(value : Json, is_static : Bool, origin? : Message) -> Array[TfStamped] raise McapError

    payload_decoder

    fn payload_decoder(decode : (Schema?, Channel, Bytes) -> Json raise McapError) -> PayloadDecoder

    payload_normalizer

    fn payload_normalizer(fields : Array[NormalizedField]) -> PayloadNormalizer raise McapError

    payload_rewriter

    fn payload_rewriter(apply : (Schema?, Channel, Bytes, Array[PayloadEdit]) -> Bytes raise McapError) -> PayloadRewriter

    protobuf_decoder

    fn protobuf_decoder(descriptor_set : Bytes, options? : ProtobufOptions) -> ProtobufDecoder raise McapError

    protobuf_json_options

    fn protobuf_json_options() -> ProtobufOptions

    protobuf_options

    fn protobuf_options() -> ProtobufOptions

    quality_rule

    fn quality_rule(topic : String) -> QualityRule

    query_file

    fn query_file(bytes : Bytes, query : Query, limits? : Limits) -> QueryResult raise McapError

    Query already-loaded bytes using MCAP chunk ranges and channel index maps. Structural validation still scans all records; this is not disk-lazy I/O.

    query_source

    fn query_source(declarations : Log, open : (Query, Int) -> MessageStream raise McapError, materialized? : Bool) -> QuerySource raise McapError

    Provider contract: stable snapshot, ordered messages, exact declarations, and truthful nonnegative pending payload accounting.

    read_diagnostics_json

    fn read_diagnostics_json(d : ReadDiagnostics) -> Json

    read_log

    fn read_log(bytes : Bytes, limits? : Limits) -> Log raise McapError

    rebuild_indexes

    fn rebuild_indexes(bytes : Bytes, compression? : Compression, messages_per_chunk? : Int, limits? : Limits) -> IndexRepair raise McapError

    Rebuild only from a complete, checked data section. Never salvage across damage.

    recording_options

    fn recording_options() -> RecordingOptions

    recording_storage

    fn recording_storage(create : (Int) -> WriteSink raise McapError, open : (Int) -> ReadSource raise McapError, exists : (Int) -> Bool raise McapError, seal : (Int) -> Unit raise McapError, save : (Bytes) -> Unit raise McapError, quarantine : (Int) -> Unit raise McapError, list : () -> Array[Int] raise McapError, fingerprint : (ReadSource) -> String raise McapError) -> RecordingStorage

    recording_tail

    fn recording_tail(identity : String, snapshot? : Bytes) -> RecordingTail raise McapError

    recover_blocks

    fn recover_blocks(source : ReadSource, sink : WriteSink, limits? : Limits, options? : StreamOptions, summary_bytes? : Int, on_block? : (BlockRecoveryEvidence) -> Unit raise McapError) -> BlockRecoveryReport raise McapError

    Explicit partial extraction, never a claim that all source records survived. Requires a nonzero verified summary CRC and a CRC on each accepted Chunk.

    recover_blocks_detailed

    fn recover_blocks_detailed(source : ReadSource, sink : WriteSink, limits? : Limits, options? : StreamOptions, summary_bytes? : Int, max_ranges? : Int) -> Json raise McapError

    recover_prefix

    fn recover_prefix(bytes : Bytes, limits? : Limits) -> RecoveryReport raise McapError

    Recover only a verified contiguous prefix. Never resynchronize through corrupt bytes.

    repair_prefix

    fn repair_prefix(bytes : Bytes, limits? : Limits) -> (Bytes, RecoveryReport) raise McapError

    Rewrites a recoverable prefix as a fresh valid sequential MCAP file.

    replay

    fn replay(source : QuerySource, query? : Query, rate_numerator? : Int, rate_denominator? : Int, pending_bytes? : Int) -> Replay raise McapError

    resample

    fn resample(inputs : Array[SyncInput], start : UInt64, end : UInt64, period : UInt64, options? : SyncOptions, cancelled? : () -> Bool) -> SyncStream raise McapError

    Uniform anchors are synthetic observations, identified by the reserved $grid input name. Endpoints and grid arithmetic stay in UInt64 nanoseconds.

    resumable_chunk_merge

    fn resumable_chunk_merge(sources : Array[ReadSource], parts_storage : SortStorage, merge_storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, max_parts? : Int, cancelled? : () -> Bool) -> Json raise McapError

    resumable_chunk_pipeline

    fn resumable_chunk_pipeline(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, max_parts? : Int, cancelled? : () -> Bool) -> Json raise McapError

    resumable_merge

    fn resumable_merge(sources : Array[ReadSource], storage : SortStorage, output : WriteSink, fingerprint : (ReadSource) -> String raise McapError, save : (Bytes) -> Unit raise McapError, checkpoint? : Bytes, options? : ExternalOptions, cancelled? : () -> Bool) -> ExternalReport raise McapError

    Resume only durable ingestion/merge boundaries. Caller atomically saves and fsyncs checkpoints and runs, owns a job lock, and removes unreferenced runs. Final output may be retried; committed runs remain until caller cleanup.

    ros1_decoder

    fn ros1_decoder(name : String, definition : Bytes, options? : CdrOptions) -> Ros1Decoder raise McapError

    run_artifact_batch

    fn run_artifact_batch(plan : String, total : Int, storage : ArtifactBatchStorage, execute : (Int, WriteSink) -> Json raise McapError, stop_after? : Int, cancelled? : () -> Bool) -> Json raise McapError

    A checkpoint is committed before publishing each completed artifact. An interrupted artifact is restarted; previously published artifacts are hashed before reuse. The plan must identify input content, processing rules and code.

    scan_file

    fn scan_file(bytes : Bytes, limits? : Limits) -> Array[Record] raise McapError

    Decode the complete file envelope. Unknown records are available to callers.

    scan_source

    fn scan_source(source : ReadSource, visitor : SourceVisitor, limits? : Limits, declaration_bytes? : Int, cancelled? : () -> Bool, trace? : (SourceScanEvent) -> Unit) -> UInt64 raise McapError

    Bounded full validation in physical order. Callbacks precede final CRC validation; callers must discard side effects if validation fails.

    shift_time

    fn shift_time(log : Log, magnitude : UInt64, backwards? : Bool) -> Log raise McapError

    Shift both clocks by a signed magnitude without signed-integer narrowing.

    slice_log

    fn slice_log(log : Log, query : Query) -> Log raise McapError

    Select messages while pruning unreachable declarations and retaining metadata.

    sort_storage

    fn sort_storage(create : (Int) -> WriteSink raise McapError, open : (Int) -> ReadSource raise McapError, remove : (Int) -> Unit raise McapError, finish? : () -> Unit raise McapError) -> SortStorage

    source_visitor

    fn source_visitor(schema? : (Schema) -> Unit raise McapError, channel? : (Channel) -> Unit raise McapError, message? : (Message, MessageLocation) -> Unit raise McapError, attachment? : (Attachment) -> Unit raise McapError, metadata? : (Metadata) -> Unit raise McapError) -> SourceVisitor

    standard_payload_decoder

    fn standard_payload_decoder(options? : ProtobufOptions, cdr? : CdrOptions, cache_bytes? : Int, max_schemas? : Int, selection? : DecodeSelection) -> PayloadDecoder raise McapError

    Schema identity includes descriptor bytes, not just a source-local schema ID.

    standard_payload_rewriter

    fn standard_payload_rewriter(options? : ProtobufOptions, cdr? : CdrOptions, cache_bytes? : Int, max_schemas? : Int) -> PayloadRewriter raise McapError

    Typed edits retain the channel's original encoding and declarations. Cache budgets account for retained schema state, not total process memory.

    start_disk_sidecar_audit

    fn start_disk_sidecar_audit(source : ReadSource, index : ReadSource, verification : IndexVerification, limits? : Limits, declaration_bytes? : Int, cache_pages? : Int, chunk_cache_bytes? : Int, index_bytes? : UInt64) -> DiskSidecarAudit raise McapError

    Headers/source envelopes are read synchronously here; pages are fed by poll.

    stats_report

    fn stats_report(stats : LogStats) -> String

    Human-readable report without converting timestamps to floating-point numbers.

    stream_context_clip

    fn stream_context_clip(source : QuerySource, sink : WriteSink, start : UInt64, end : UInt64, topics? : Array[String], context? : Array[ContextRule], options? : ClipStreamOptions, auxiliary? : (StreamWriter) -> Unit raise McapError, provenance? : Json, cancelled? : () -> Bool) -> Json raise McapError

    Bounded context plus one pulled message and the writer's chunk/summary state. Sink publication is the caller's transaction. Failure leaves an invalid prefix.

    stream_options

    fn stream_options() -> StreamOptions

    stream_rewrite_payload

    fn stream_rewrite_payload(source : ReadSource, sink : WriteSink, edits : Array[PayloadEdit], topics? : Array[String], rewriter? : PayloadRewriter, copy_auxiliary? : Bool, options? : StreamOptions, limits? : Limits, cancelled? : () -> Bool) -> Json raise McapError

    Rewrite message payloads in physical order, retaining timestamps, sequence, declarations and optionally auxiliary records. Caller owns sink publication.

    stream_transform

    fn stream_transform(source : ReadSource, storage : SortStorage, output : WriteSink, options : TransformOptions, external? : ExternalOptions, content? : JsonFilter, cancelled? : () -> Bool) -> TransformReport raise McapError

    Multi-pass bounded transformation. Sorting, selected messages and merge runs share the same physical temporary-space budget. No historical Message array.

    summarize

    fn summarize(log : Log) -> LogStats raise McapError

    sync_input

    fn sync_input(name : String, stream : MessageStream, clock? : (Message) -> UInt64 raise McapError, interpolation_paths? : Array[String]) -> SyncInput

    sync_options

    fn sync_options() -> SyncOptions

    sync_row_json

    fn sync_row_json(row : SyncRow, payload? : (Message) -> Json raise McapError) -> Json raise McapError

    The default payload representation is Base64. A JSON-decoded stream can supply a strict JSON callback. Interpolation brackets retain source envelopes.

    synchronize

    fn synchronize(inputs : Array[SyncInput], options? : SyncOptions, cancelled? : () -> Bool) -> SyncStream raise McapError

    Inputs must be monotonic in their selected clocks. The first input supplies anchor rows. Consume is greedy and prevents reuse, not a global assignment.

    temporal_join

    fn temporal_join(left : MessageStream, right : MessageStream, options? : JoinOptions) -> TemporalJoinStream raise McapError

    temporal_join_cursor

    fn temporal_join_cursor(options? : JoinOptions) -> TemporalJoinCursor raise McapError

    tf_apply

    fn tf_apply(t : TfTransform, p : TfVector) -> TfVector raise McapError

    tf_compose

    fn tf_compose(a : TfTransform, b : TfTransform) -> TfTransform raise McapError

    tf_identity

    fn tf_identity() -> TfTransform

    tf_inverse

    fn tf_inverse(t : TfTransform) -> TfTransform raise McapError

    tf_stamped_json

    fn tf_stamped_json(s : TfStamped) -> Json

    tf_transform_json

    fn tf_transform_json(t : TfTransform) -> Json

    tf_tree

    fn tf_tree(sample_limit? : Int, byte_limit? : Int) -> TfTree raise McapError

    transform_log

    fn transform_log(log : Log, options : TransformOptions) -> Log raise McapError

    Filters and samples before pagination. Renames are simultaneous and retain channel IDs. Sampling selects the first physical message in each time bucket, separately per channel.

    transform_options

    fn transform_options() -> TransformOptions

    transform_report_json

    fn transform_report_json(report : TransformReport) -> Json

    trigger_options

    fn trigger_options() -> TriggerOptions

    trigger_recorder

    fn trigger_recorder(template : Log, emit : (Log, Json) -> Unit raise McapError, options? : TriggerOptions) -> TriggerRecorder raise McapError

    The callback is synchronous backpressure: feed/trigger/finish do not return until output is accepted. Buffers are volatile, unlike RecordingSession.

    validate_attachment_indexes

    fn validate_attachment_indexes(bytes : Bytes, limits? : Limits) -> Int raise McapError

    validate_file_indexes

    fn validate_file_indexes(bytes : Bytes, limits? : Limits) -> Array[ChunkIndex] raise McapError

    Check physical index pointers against record boundaries and chunk contents.

    validate_file_statistics

    fn validate_file_statistics(log : Log, value : FileStatistics, chunk_count : UInt) -> Unit raise McapError

    validate_log

    fn validate_log(log : Log, limits? : Limits) -> Unit raise McapError

    validate_message_index

    fn validate_message_index(index : MessageIndex, chunk : Chunk) -> Unit raise McapError

    Verify index tuples refer to actual Message records inside the same chunk.

    validate_metadata_indexes

    fn validate_metadata_indexes(bytes : Bytes, limits? : Limits) -> Int raise McapError

    validate_summary

    fn validate_summary(bytes : Bytes, limits? : Limits) -> Int raise McapError

    Check grouped summary records and every declared SummaryOffset span.

    verify_crc

    fn verify_crc(bytes : Bytes, expected : UInt, label? : String) -> Unit raise McapError

    worker_chunk_properties

    fn worker_chunk_properties(body : Bytes, limits? : Limits) -> (Int, String) raise McapError

    Validated response bound from the original Chunk envelope, before expansion.

    write_chunked

    fn write_chunked(log : Log, messages_per_chunk? : Int, checksums? : Bool, compression? : Compression, limits? : Limits) -> Bytes raise McapError

    write_indexed

    fn write_indexed(log : Log, messages_per_chunk? : Int, compression? : Compression, limits? : Limits) -> Bytes raise McapError

    Serialize MessageIndex, ChunkIndex, grouped summary and SummaryOffset records.

    write_log

    fn write_log(log : Log, checksums? : Bool, limits? : Limits) -> Bytes raise McapError

    Minimal interoperable layout; zero summary pointers mean a sequential file.