Expand description
Public crate surface for scriv. Modules stay internal and are re-exported here to keep the external API stable.
Structs§
- List
Options - Options for
list_notesfiltering, sorting, and output shape. - Note
- Persisted note record stored as NDJSON.
Constants§
- ENCRYPTED_
MAGIC - File signature for encrypted note payloads.
Functions§
- active_
password - Get current active password value.
- add_
note - Create and persist a new note with
max(existing_id) + 1semantics. - append_
note - Append text to a note and set
updated_at. - clear_
notes - Remove all notes.
- collect_
tags - Build tag usage counts across a set of notes.
- decrypt_
notes - Decrypt note bytes previously produced by
encrypt_notes. - edit_
note - Replace note text and set
updated_at. - encrypt_
notes - Encrypt NDJSON note bytes using AES-256-GCM and PBKDF2 key derivation.
- get_
note - Fetch one note by id.
- highlight_
match - ANSI-highlight all case-insensitive matches of
queryinsidetext. - import_
notes - Import notes and reassign ids to avoid conflicts.
- is_
encrypted_ data - Quick header check used to detect encrypted files.
- list_
notes - List notes with optional tag filtering, sort mode, and result limit.
- load_
notes - Load notes from disk. Missing files are treated as an empty dataset.
- note_
age - Convert an RFC3339 UTC timestamp into a compact relative-age label.
- notes_
file_ is_ encrypted - Return true when the on-disk notes file starts with the encrypted magic header.
- notes_
path - Resolve the platform-specific notes file path.
- read_
stdin_ text - Read piped stdin as trimmed multi-line text.
- remove_
note - Remove a single note by id.
- remove_
notes - Remove multiple notes by id. In non-force mode, operation is all-or-nothing.
- save_
notes - Persist notes to disk using atomic replacement via a temporary file to reduce corruption risk.
- search_
notes - Search notes by text or tag (case-insensitive substring match).
- set_
active_ password - Set in-memory password used for decrypting/encrypting notes.
- set_
notes_ path_ override - Override notes path for tests and controlled environments.
- tag_
note - Add tags to a note while preserving existing tags and deduplicating new ones.
- untag_
note - Remove one tag from a note if present.