21 lines
533 B
Rust
21 lines
533 B
Rust
//! Browsing history management
|
|
//!
|
|
//! Port of `history.c` / `history.h` from the C project.
|
|
|
|
use crate::db;
|
|
|
|
/// Add a history entry.
|
|
pub fn history_add(url: &str, title: &str) -> Result<(), Box<dyn std::error::Error>> {
|
|
db::db_add_history(url, title)
|
|
}
|
|
|
|
/// Get history entries.
|
|
pub fn history_get(limit: u64) -> Result<Vec<serde_json::Value>, Box<dyn std::error::Error>> {
|
|
db::db_get_history(limit)
|
|
}
|
|
|
|
/// Clear all history.
|
|
pub fn history_clear() -> Result<(), Box<dyn std::error::Error>> {
|
|
db::db_clear_history()
|
|
}
|