unobtanium 3.0.0

Opinioated Web search engine library with crawler and viewer companion.
Documentation
use serde::{Serialize,Deserialize};

/// Collection of flags to describe relevant document locations.
/// 
/// The location signature saves one from traversing (or even storing)
/// a document tree or finding all the important parent elements that
/// have semantic meaning.
/// The flags are set when the crawler has to traverse the documents tree anyway.
/// The names used here represent the corresponding html tag names.
#[derive(Debug,Clone,Default,Serialize,Deserialize)]
pub struct LocationSignature {
	#[serde(default, skip_serializing_if="not")]
	pub in_header: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_footer: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_aside: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_nav: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_form: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_main: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_article: bool,

	#[serde(default, skip_serializing_if="not")]
	pub in_section: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_table: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_figure: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_address: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_code: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_headline: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_list: bool,
	#[serde(default, skip_serializing_if="not")]
	pub in_paragraph: bool,

}

fn not(b: &bool) -> bool { !b }