use crate::{ addressing::Address, database::{entry::Entry, UpEndConnection}, util::jobs::JobContainer, }; use anyhow::Result; use std::sync::{Arc, RwLock}; #[cfg(feature = "extractors-web")] pub mod web; pub trait Extractor { fn get(&self, address: Address, job_container: Arc>) -> Result>; fn insert_info( &self, address: Address, connection: UpEndConnection, job_container: Arc>, ) -> Result<()> { let entries = self.get(address, job_container)?; connection.transaction(|| { for entry in entries { connection.insert_entry(entry)?; } Ok(()) }) } }