pub struct NoteItem<'a> {
pub name_id: u16,
pub type_flags: u16,
pub value: &'a [u8],
}Expand description
One parsed note item: its name id, type/flags, and raw value bytes.
Fields§
§name_id: u16Unique Name Key id of the field name. The name string itself lives in the BDB UNK table (name resolution is a later slice); the id is stable within a database so callers can group / correlate fields.
type_flags: u16Item type + flag bits (the low byte distinguishes the value type family; high bits carry summary / sign flags).
value: &'a [u8]Raw value bytes, exactly value_size long.
Implementations§
Source§impl<'a> NoteItem<'a>
impl<'a> NoteItem<'a>
Sourcepub fn as_text(&self) -> String
pub fn as_text(&self) -> String
Best-effort text rendering of the value: runs of printable ASCII are
kept, other bytes become .. Lotus text items (the common case for
names, addresses, e-mail) render cleanly; binary values (numbers,
timedates, rich text) render as dotted placeholders. Lossless access
to the original bytes is via Self::value.
Sourcepub fn is_printable_text(&self) -> bool
pub fn is_printable_text(&self) -> bool
True if the value is entirely printable ASCII (a clean text field).
Sourcepub fn display_value(&self) -> String
pub fn display_value(&self) -> String
Best-effort human rendering of the value by shape (the on-disk note summary does not carry a per-item type tag, so this infers it):
- printable bytes -> text;
- 8 bytes that validate as a TIMEDATE (sane Julian-day range) -> ISO date; otherwise an IEEE-754 double (the Notes NUMBER type) when it is a sane magnitude;
- 1/2/4 bytes -> unsigned integer;
- anything else -> a hex byte summary.
This is a display aid, not an authoritative type decode (proper
per-field typing from the form design is a later slice). The raw
bytes remain available via Self::value.
Source§impl NoteItem<'_>
impl NoteItem<'_>
Sourcepub fn render(&self, kind: FieldKind) -> String
pub fn render(&self, kind: FieldKind) -> String
Render the value using the authoritative FieldKind (from the BDB
UNK table) rather than guessing by shape. Rich-text and attachment
values live in the note’s non-summary data; here they render as a
kind marker (use Database::non_summary_data for the content).