Skip to main content

NoteItem

Struct NoteItem 

Source
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: u16

Unique 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: u16

Item 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>

Source

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.

Source

pub fn is_printable_text(&self) -> bool

True if the value is entirely printable ASCII (a clean text field).

Source

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<'_>

Source

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).

Trait Implementations§

Source§

impl<'a> Clone for NoteItem<'a>

Source§

fn clone(&self) -> NoteItem<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for NoteItem<'a>

Source§

impl<'a> Debug for NoteItem<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for NoteItem<'a>

§

impl<'a> RefUnwindSafe for NoteItem<'a>

§

impl<'a> Send for NoteItem<'a>

§

impl<'a> Sync for NoteItem<'a>

§

impl<'a> Unpin for NoteItem<'a>

§

impl<'a> UnsafeUnpin for NoteItem<'a>

§

impl<'a> UnwindSafe for NoteItem<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.