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§

MAX_NOTE_BYTES
Maximum allowed byte length for note text.

Functions§

active_passwordDeprecated
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.
edit_note
Replace note text and set updated_at.
get_note
Fetch one note by id.
has_active_password
Check whether an active password is currently set.
highlight_match
ANSI-highlight all case-insensitive matches of query inside text.
import_notes
Import notes and reassign ids to avoid conflicts.
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 (capped at 10 MB).
remove_note
Remove a single note by id.
remove_notes
Remove multiple notes by id. In non-force mode, operation is all-or-nothing.
sanitize_display
Remove terminal control characters from user content before display.
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_active_password_zeroized
Set in-memory password from a zeroized source, avoiding an intermediate plain String.
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 (case-insensitive). No-op if the tag is absent.
validate_note
Validate a whole note record, enforcing the same invariants for every entry path (creation, editing, and import).