unobtanium 3.0.0

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

use crate::crawling::ExitCode;
use crate::database::id::CrawlLogEntryId;
use crate::summary::HttpSummary;
use crate::time::UtcTimestamp;
use crate::url::UrlWithoutFragment;

/// Logs a request that was made as part of a crawl.
#[derive(Debug,Serialize,Deserialize)]
pub struct Request {
	/// Numeric id of the entry in the crawl_log
	///
	/// TODO: Use a uuid here
	#[serde(skip)]
	pub crawl_log_entry: CrawlLogEntryId,

	/// If the request was approved by the robots.txt file
	///
	/// Unapproved request may be mede to see if a link is still alive.
	pub robotstxt_approved: bool,
	
	/// The url requested
	pub url: UrlWithoutFragment,
	
	/// When the request was sent
	pub time_sent: UtcTimestamp,

	/// How long it took until an answer came back and processing could start
	///
	/// If None, measuring failed.
	pub request_duration_ms: Option<i64>,
	
	/// When the last modification date was according to the server
	pub server_last_modified: Option<UtcTimestamp>,
	
	/// Exit code that inicates what the request resulted in 
	pub exit_code: ExitCode,
	
	/// If the crawl involved an http fetch
	/// the resultng metadata is in here.
	pub http: Option<HttpSummary>,
}