kimun_core
Core library for Kimün — handles note vault management, file system abstraction, and SQLite-based indexing.
Usage
[]
= "0.3.1"
Overview
The library revolves around NoteVault, the main entry point. A vault is a directory of Markdown files. kimun_core maintains a kimun.sqlite index at the vault root for fast search and metadata queries.
use NoteVault;
// Open a vault (creates the index if it doesn't exist)
let vault = new.await?;
// Validate and sync the index with the filesystem
vault.init_and_validate.await?;
Key Types
NoteVault
The main handle for all vault operations: indexing, browsing, searching, and file management.
| Method | Description |
|---|---|
new(path) |
Open a vault at the given path |
init_and_validate() |
Check the index and sync any new/removed notes |
force_rebuild() |
Delete and fully rebuild the index |
recreate_index() |
Rebuild the index without deleting the database file |
nfs — Filesystem Abstraction
VaultPath— a vault-relative path (always uses/as separator). Use this instead of rawPathBuffor all vault operations.VaultEntry— an entry found at aVaultPath. Thedatafield is one of:EntryData::Note(NoteEntryData)— a Markdown fileEntryData::Directory(DirectoryEntryData)— a subdirectoryEntryData::Attachment— any other file
note — Note Parsing
Provides NoteDetails (title, date, metadata) and ContentChunk for splitting note content into indexable sections based on Markdown headings.
error — Error Types
VaultError— top-level error wrapping all vault operationsFSError— filesystem errorsDBError— database errors
Notes
- Requires Tokio async runtime
- The index file (
kimun.sqlite) is created automatically in the vault root - Notes must be
.mdfiles; other files are treated as attachments