use crate::engine::found_urls::FoundUrls;
use crate::engine::parsed_url::ParsedUrl;
use crate::types::ContentTypeId;
pub trait ContentProcessor: Send + Sync {
fn find_urls(&self, content: &str, source_url: &ParsedUrl) -> Option<FoundUrls>;
fn apply_content_changes_before_url_parsing(
&self,
content: &mut String,
content_type: ContentTypeId,
url: &ParsedUrl,
);
fn apply_content_changes_for_offline_version(
&self,
content: &mut String,
content_type: ContentTypeId,
url: &ParsedUrl,
remove_unwanted_code: bool,
);
fn apply_content_changes_for_offline_version_with_loader(
&self,
content: &mut String,
content_type: ContentTypeId,
url: &ParsedUrl,
remove_unwanted_code: bool,
_content_loader: &dyn Fn(&str) -> Option<String>,
) {
self.apply_content_changes_for_offline_version(content, content_type, url, remove_unwanted_code);
}
fn is_content_type_relevant(&self, content_type: ContentTypeId) -> bool;
fn get_name(&self) -> &str;
fn set_debug_mode(&mut self, debug_mode: bool);
}