sherlock_nsf_parser/lib.rs
1//! Read-only parser for IBM / HCL Lotus Notes Storage Facility (NSF)
2//! databases. Pure Rust, no FFI, no Notes client required.
3//!
4//! Current capability surface:
5//!
6//! - File-shape identification ([`detect`])
7//! - Database header parsing ([`header::DbHeader`]) - ODS version,
8//! database id, encryption flag, template flag, BDB position
9//! - Database information extension block 2 parsing
10//! ([`info2::Information2`]) - 4 superblock positions + 2 BDB positions
11//! + bucket-size knobs
12//! - Superblock header parsing ([`superblock::Superblock`]) plus
13//! freshest-of-4-copies selection ([`superblock::select_freshest`])
14//! - Bucket header parsing ([`bucket::BucketHeader`]) + RRV bucket header
15//! + per-entry decoder ([`rrv::RrvIter`])
16//! - Note record header parsing ([`note::NoteHeader`]) with class
17//! catalogue + UNID composition
18//! - High-level [`database::Database`] handle with data-RRV walking
19//! - Bucket Descriptor Block parsing ([`bdb::BucketDescriptorBlock`]) - the
20//! master index of every RRV bucket
21//! - Multi-page summary bucket-descriptor map + bucket-slot resolution
22//! ([`database::Database::resolve_bucket_slot`]) and identity-gated
23//! full-database note enumeration
24//! ([`database::Database::enumerate_notes`]) (Slice 2.6 Phase B.2)
25//! - Per-note item parsing with real field names + authoritative typing
26//! ([`item::NoteItem`], [`item::FieldKind`]) sourced from the BDB Unique
27//! Name Key table
28//! - CD-record stream walking for rich-text bodies + OBJECT-item attachment
29//! extraction ([`cd::NoteContent`], [`database::Database::note_content`])
30//! - TIMEDATE timestamp parsing ([`time::Timedate`])
31//! - ODS version mapping ([`ods::Ods`])
32//!
33//! Coming in subsequent slices:
34//!
35//! - Form-based dispatch (Memo / Person / Appointment / ...)
36//! - Item-level encryption decryption (detected + flagged today)
37//!
38//! See the project README for current capability status and the
39//! companion `priorart_nsf_format.md` for the design rationale and
40//! format reference.
41//!
42//! # Versioning
43//!
44//! This crate is pre-1.0 and under active development. Public API may
45//! break between 0.x releases as format coverage grows.
46
47#![forbid(unsafe_code)]
48#![warn(missing_docs)]
49#![warn(rust_2018_idioms)]
50
51pub mod bdb;
52pub mod bdt;
53pub mod bucket;
54pub mod cd;
55pub mod cx;
56pub mod database;
57pub mod detect;
58pub mod error;
59pub mod header;
60pub mod info2;
61pub mod item;
62pub mod note;
63pub mod ods;
64pub mod rrv;
65pub mod superblock;
66pub mod time;
67
68pub use bdb::{BucketDescriptorBlock, RrvBucketDescriptor, RrvBucketKind};
69pub use cd::{Attachment, AttachmentKind, NoteContent};
70pub use bdt::BucketDescriptorTable;
71pub use bucket::{Bucket, BucketHeader, BucketSlot};
72pub use database::{Database, NoteEnumeration, ResolvedNote};
73pub use detect::{identify_file, FileKind};
74pub use error::NsfError;
75pub use header::DbHeader;
76pub use info2::{BdbSlot, Information2, SuperblockSlot};
77pub use item::{field_kind, parse_items, FieldKind, NoteItem};
78pub use note::NoteHeader;
79pub use ods::Ods;
80pub use rrv::{RrvBucketHeader, RrvEntry, RrvIter, RrvLocation};
81pub use superblock::{select_freshest, Superblock};
82pub use time::{DecodedTimedate, Timedate};