Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Feb 6, 2024
1 parent d111b53 commit 858b3b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/history/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,14 @@ pub trait History: Send {
/// load a history item by its id
fn load(&self, id: HistoryItemId) -> Result<HistoryItem>;

/// retrieves the next unused session id
/// count the results of a query
fn count(&self, query: SearchQuery) -> Result<u64>;

/// return the total number of history items
fn count_all(&self) -> Result<u64> {
self.count(SearchQuery::everything(SearchDirection::Forward, None))
}

/// return the results of a query
fn search(&self, query: SearchQuery) -> Result<Vec<HistoryItem>>;

Expand All @@ -216,12 +215,16 @@ pub trait History: Send {
id: HistoryItemId,
updater: &dyn Fn(HistoryItem) -> HistoryItem,
) -> Result<()>;

/// delete all history items
fn clear(&mut self) -> Result<()>;

/// remove an item from this history
fn delete(&mut self, h: HistoryItemId) -> Result<()>;

/// ensure that this history is written to disk
fn sync(&mut self) -> std::io::Result<()>;

/// get the history session id
fn session(&self) -> Option<HistorySessionId>;
}
Expand Down

0 comments on commit 858b3b5

Please sign in to comment.