reorganize clone semantics, implement recently closed tabs history

This commit is contained in:
yggverse 2025-01-12 04:02:41 +02:00
parent 3682b5bf3f
commit ba68019614
17 changed files with 176 additions and 52 deletions

View file

@ -1,18 +1,24 @@
mod database;
// mod database;
mod memory;
use sqlite::Transaction;
use memory::Memory;
// Tools
use sqlite::Connection;
use std::{rc::Rc, sync::RwLock};
pub fn migrate(tx: &Transaction) -> Result<(), String> {
// Migrate self components
if let Err(e) = database::init(tx) {
return Err(e.to_string());
}
// Delegate migration to childs
// nothing yet..
// Success
Ok(())
pub struct History {
pub memory: Rc<Memory>, // fast search index
}
impl History {
// Constructors
/// Create new `Self`
pub fn build(_connection: &Rc<RwLock<Connection>>, _profile_id: &Rc<i64>) -> Self {
// Init children components
let memory = Rc::new(Memory::new());
// Return new `Self`
Self { memory }
}
}