pub struct VetaService<D: Database> { /* private fields */ }Expand description
The main service that contains all business logic. Generic over the database implementation.
Implementations§
Source§impl<D: Database> VetaService<D>
impl<D: Database> VetaService<D>
pub fn new(db: D) -> Self
Sourcepub async fn add_note(
&self,
title: String,
body: String,
tags: Vec<String>,
references: Vec<String>,
) -> Result<i64, Error>
pub async fn add_note( &self, title: String, body: String, tags: Vec<String>, references: Vec<String>, ) -> Result<i64, Error>
Add a new note.
Sourcepub async fn list_notes(
&self,
query: NoteQuery,
) -> Result<Vec<NoteSummary>, Error>
pub async fn list_notes( &self, query: NoteQuery, ) -> Result<Vec<NoteSummary>, Error>
List notes with optional filters.
Sourcepub async fn count_notes(&self, query: NoteQuery) -> Result<i64, Error>
pub async fn count_notes(&self, query: NoteQuery) -> Result<i64, Error>
Count notes matching the query (ignores limit).
Sourcepub async fn update_note(
&self,
id: i64,
update: UpdateNote,
) -> Result<bool, Error>
pub async fn update_note( &self, id: i64, update: UpdateNote, ) -> Result<bool, Error>
Update an existing note.
List all tags with counts.
Auto Trait Implementations§
impl<D> Freeze for VetaService<D>where
D: Freeze,
impl<D> RefUnwindSafe for VetaService<D>where
D: RefUnwindSafe,
impl<D> Send for VetaService<D>where
D: Send,
impl<D> Sync for VetaService<D>where
D: Sync,
impl<D> Unpin for VetaService<D>where
D: Unpin,
impl<D> UnwindSafe for VetaService<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more