XinOrigin/moon_warc/cdxj does not have a README file

    CdxjEntry

    pub(all) struct CdxjEntry {
    surt : String
    timestamp : String
    url : String
    mime : String?
    status : Int?
    digest : String?
    length : Int64
    offset : Int64
    filename : String
    warc_type : String
    } derive(Eq,
    Debug
    )

    Single CDXJ archival index entry (<surt> <timestamp> <json>).

    CdxjError

    pub(all) enum CdxjError {
    InvalidLineFormat(String)
    InvalidJsonBlock(String)
    MissingJsonField(String)
    } derive(Eq,
    Debug
    )

    Errors returned while parsing CDXJ index lines.

    CdxjIndex

    pub struct CdxjIndex {
    // private fields
    } derive(Eq,
    Debug
    )

    Sorted CDXJ index supporting fast binary-search queries. Internal entries slice is private to uphold lexicographic sorting invariant.

    CdxjIndex::build

    fn CdxjIndex::build(records : Array[
    WarcRecord
    ], filename? : String) -> CdxjIndex

    Builds a lexicographically sorted CdxjIndex from parsed WARC records.

    CdxjIndex::entries

    fn CdxjIndex::entries(self : CdxjIndex) -> Array[CdxjEntry]

    Returns a defensive copy of all sorted entries in the index.

    CdxjIndex::format_all

    fn CdxjIndex::format_all(self : CdxjIndex) -> String

    Renders all entries as newline-separated CDXJ lines.

    CdxjIndex::from_entries

    fn CdxjIndex::from_entries(entries : Array[CdxjEntry]) -> CdxjIndex

    Builds a lexicographically sorted CdxjIndex from pre-constructed CdxjEntry values.

    CdxjIndex::get

    fn CdxjIndex::get(self : CdxjIndex, index : Int) -> CdxjEntry?

    Returns the i-th sorted entry if index is within bounds.

    CdxjIndex::is_empty

    fn CdxjIndex::is_empty(self : CdxjIndex) -> Bool

    Returns true when the index contains no entries.

    CdxjIndex::length

    fn CdxjIndex::length(self : CdxjIndex) -> Int

    Returns the number of entries in the sorted index.

    CdxjIndex::lookup_closest

    fn CdxjIndex::lookup_closest(self : CdxjIndex, url : StringView, target_timestamp : StringView) -> CdxjEntry?

    Finds the entry for url closest in capture time to target_timestamp (YYYYMMDDhhmmss).

    CdxjIndex::lookup_exact

    fn CdxjIndex::lookup_exact(self : CdxjIndex, url : StringView) -> Array[CdxjEntry]

    Finds all entries whose SURT matches url using binary search.

    CdxjIndex::lookup_prefix

    fn CdxjIndex::lookup_prefix(self : CdxjIndex, surt_prefix : StringView) -> Array[CdxjEntry]

    Finds all entries whose SURT starts with surt_prefix using binary search.

    format_line

    fn format_line(entry : CdxjEntry) -> String

    Formats a CdxjEntry as <surt> <timestamp> <json> using canonical JSON escaping.

    from_record

    fn from_record(record :
    WarcRecord
    , filename? : String) -> CdxjEntry?

    Builds a CdxjEntry from an indexable WARC record (response, resource, revisit, conversion).

    parse_line

    fn parse_line(line_view : StringView) -> Result[CdxjEntry, CdxjError]

    Parses a single CDXJ line (<surt> <timestamp> <json>).

    Source Files