Skip to main content

Crate scriv

Crate scriv 

Source
Expand description

Public crate surface for scriv. Modules stay internal and are re-exported here to keep the external API stable.

Structs§

ListOptions
Options for list_notes filtering, 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) + 1 semantics.
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 query inside text.
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.