diff --git a/src/internal/streaming/archive_backfill.zig b/src/internal/streaming/archive_backfill.zig index 6b0822b..f2a84d0 100644 --- a/src/internal/streaming/archive_backfill.zig +++ b/src/internal/streaming/archive_backfill.zig @@ -259,6 +259,22 @@ const FetchWindow = struct { } }; +/// decode every block of a sealed in-memory jss segment through `handler` — +/// the offline counterpart of `run` for a segment already on disk (local +/// archive copies, getSegment bodies fetched out-of-band). same delivery +/// contract; Options.host is unused. honors collections/dids/max_blocks/ +/// verify_checksums. +pub fn replaySegment(allocator: Allocator, body: []const u8, options: Options, handler: anytype) !Result { + var result: Result = .{ .planned_through_seq = 0, .sealed_tip_seq = 0 }; + try deliverSegment(allocator, body, options, .{ + .name = "", + .index = 0, + .checksum = null, + .blocks = null, + }, handler, &result); + return result; +} + /// resume skip: everything at or before start_after is already delivered fn skippedByResume(start_after: ?Position, segment_index: u32, block_index: u32) bool { const sa = start_after orelse return false;