pub trait NoteStore:
Send
+ Sync
+ 'static {
// Required methods
fn upsert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_notes<'life0, 'async_trait>(
&'life0 self,
notes: Vec<Note>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_note_including_deleted<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_note_properties<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
properties: Option<Value>,
updated_at: i64,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn query_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn query_notes_filtered<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn query_notes_filtered_bounded<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
max_rows: u32,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn count_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn try_insert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn get_notes_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Temporal-referential note CRUD over the notes substrate table.
Required Methods§
Sourcefn upsert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a single note.
Sourcefn upsert_notes<'life0, 'async_trait>(
&'life0 self,
notes: Vec<Note>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_notes<'life0, 'async_trait>(
&'life0 self,
notes: Vec<Note>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a batch of notes.
Sourcefn get_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a note by UUID, returning None if absent.
Sourcefn get_note_including_deleted<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_note_including_deleted<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a note by UUID regardless of soft-deletion state.
Returns the note row even when deleted_at is set. Callers use this
to distinguish “soft-deleted” from “never existed”.
Sourcefn delete_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_note<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete a note by UUID using the specified delete mode.
Sourcefn update_note_properties<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
properties: Option<Value>,
updated_at: i64,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_note_properties<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
properties: Option<Value>,
updated_at: i64,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Patch properties/updated_at on an existing note in place via a real
UPDATE, leaving every other column (including the row’s rowid)
untouched.
Unlike upsert_note (an INSERT OR REPLACE, which on a primary-key
conflict is a SQLite DELETE+INSERT that silently reassigns the row’s
implicit rowid), this never churns rowid, which is required by any
caller relying on rowid as a stable, monotonically-increasing cursor (#780).
Returns true when a live (non-soft-deleted) row with this id was
found and updated, false otherwise.
Sourcefn query_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Query notes by namespace and optional kind with pagination.
Sourcefn query_notes_filtered<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_notes_filtered<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Query notes with property-based filtering and custom sort.
Sourcefn query_notes_filtered_bounded<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
max_rows: u32,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn query_notes_filtered_bounded<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: &'life2 NoteFilter,
max_rows: u32,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch up to max_rows + 1 notes matching filter in a single
deterministically-ordered SQL statement, with no separate COUNT(*)
and no pagination loop.
A single statement observes one consistent snapshot for its entire
execution, so the result cannot be split across a concurrent insert
the way a COUNT(*) followed by independent LIMIT/OFFSET pages
can. Callers detect the over-bound case by checking whether the
returned Vec has more than max_rows items — that means at least
max_rows + 1 rows matched and the caller must reject the query
rather than silently return a truncated, possibly priority-incomplete
set.
Sourcefn count_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn count_notes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
kind: Option<&'life2 str>,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Count notes in a namespace, optionally filtered by kind.
Sourcefn try_insert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn try_insert_note<'life0, 'async_trait>(
&'life0 self,
note: Note,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempt to insert a note without overwriting an existing row.
Returns true when the row was newly written. Returns false only
when a live note with the same non-empty external_id already exists in
the same namespace and kind (confirmed dedup hit). Any other constraint
violation (e.g. a primary key collision) is surfaced as a StorageError
so that callers do not misinterpret unexpected failures as deduplication.
Provided Methods§
Sourcefn get_notes_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_notes_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
ids: &'life1 [Uuid],
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<Note>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch multiple notes by UUID in a single call.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".