Skip to content

Commit

Permalink
chore(docs): fix spider cargo docs
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Jan 8, 2025
1 parent e39f5db commit 076119f
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 50 deletions.
47 changes: 23 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions spider/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider"
version = "2.24.12"
version = "2.24.13"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand All @@ -11,7 +11,7 @@ keywords = ["crawler", "spider", "scraper"]
categories = ["web-programming", "command-line-utilities"]
license = "MIT"
documentation = "https://docs.rs/spider"
edition = "2018"
edition = "2021"

[badges]
maintenance = { status = "as-is" }
Expand Down Expand Up @@ -61,7 +61,7 @@ string-interner = { version = "0.18", default-features = false, features = ["std
httpdate = { version = "1", optional = true }
rand = { version = "0.8", optional = true }
serde_regex = { version = "1", optional = true }
statrs = { version = "0.17", optional = true }
statrs = { version = "0.18", optional = true }
aho-corasick = { version = "1", optional = true }
tracing = { version = "0.1", default-features = false, features = ["std"], optional = true }
sysinfo = { version = "0.33", default-features = false, features = ["system"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions spider/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ impl Configuration {
}

#[cfg(not(feature = "chrome"))]
/// Wait for idle dom mutations for target element. This method does nothing if the [chrome] feature is not enabled.
/// Wait for idle dom mutations for target element. This method does nothing if the `chrome` feature is not enabled.
pub fn with_wait_for_idle_dom(
&mut self,
_wait_for_idle_dom: Option<WaitForSelector>,
Expand All @@ -803,7 +803,7 @@ impl Configuration {
}

#[cfg(feature = "chrome")]
/// Wait for a selector. This method does nothing if the [chrome] feature is not enabled.
/// Wait for a selector. This method does nothing if the `chrome` feature is not enabled.
pub fn with_wait_for_selector(
&mut self,
wait_for_selector: Option<WaitForSelector>,
Expand Down
28 changes: 14 additions & 14 deletions spider/src/website.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl Website {
string_concat!(self.crawl_id, self.url.inner())
}

/// Setup SQLite. This does nothing with [disk] flag enabled.
/// Setup SQLite. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
pub fn setup_disk(&mut self) {
if !self.sqlite.pool_inited() {
Expand All @@ -349,17 +349,17 @@ impl Website {
}
}

/// Setup SQLite. This does nothing with [disk] flag enabled.
/// Setup SQLite. This does nothing with `disk` flag enabled.
#[cfg(not(feature = "disk"))]
pub fn setup_disk(&mut self) {}

/// Get the db pool. This does nothing with [disk] flag enabled.
/// Get the db pool. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn get_db_pool(&self) -> &sqlx::SqlitePool {
self.sqlite.get_db_pool().await
}

/// Check if URL exists (ignore case). This does nothing with [disk] flag enabled.
/// Check if URL exists (ignore case). This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn is_allowed_disk(&self, url_to_check: &str) -> bool {
if !self.sqlite.ready() {
Expand All @@ -372,33 +372,33 @@ impl Website {
}
}

/// Check if URL exists (ignore case). This does nothing with [disk] flag enabled.
/// Check if URL exists (ignore case). This does nothing with `disk` flag enabled.
#[cfg(not(feature = "disk"))]
async fn is_allowed_disk(&self, _url_to_check: &str) -> bool {
true
}

/// Clear the disk. This does nothing with [disk] flag enabled.
/// Clear the disk. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn clear_disk(&self) {
if self.sqlite.pool_inited() {
let _ = DatabaseHandler::clear_table(self.get_db_pool().await).await;
}
}

/// Clear the disk. This does nothing with [disk] flag enabled.
/// Clear the disk. This does nothing with `disk` flag enabled.
#[cfg(not(feature = "disk"))]
async fn clear_disk(&self) {}

/// Insert a new URL to disk if it doesn't exist. This does nothing with [disk] flag enabled.
/// Insert a new URL to disk if it doesn't exist. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn insert_url_disk(&self, new_url: &CaseInsensitiveString) {
self.sqlite
.insert_url(self.get_db_pool().await, new_url)
.await
}

/// Insert a new URL if it doesn't exist. This does nothing with [disk] flag enabled.
/// Insert a new URL if it doesn't exist. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn insert_link(&mut self, new_url: CaseInsensitiveString) {
let mem_load = crate::utils::detect_system::get_global_memory_state().await;
Expand All @@ -423,13 +423,13 @@ impl Website {
}
}

/// Insert a new URL if it doesn't exist. This does nothing with [disk] flag enabled.
/// Insert a new URL if it doesn't exist. This does nothing with `disk` flag enabled.
#[cfg(not(feature = "disk"))]
async fn insert_link(&mut self, link: CaseInsensitiveString) {
self.links_visited.insert(link);
}

/// Seed the DB and clear the Hashset. This does nothing with [disk] flag enabled.
/// Seed the DB and clear the Hashset. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
async fn seed(&mut self) -> Result<(), sqlx::Error> {
let links = self.get_links();
Expand Down Expand Up @@ -790,13 +790,13 @@ impl Website {
self.pages.as_ref()
}

/// Links visited getter for disk. This does nothing with [disk] flag enabled.
/// Links visited getter for disk. This does nothing with `disk` flag enabled.
#[cfg(not(feature = "disk"))]
pub async fn get_links_disk(&self) -> HashSet<CaseInsensitiveString> {
Default::default()
}

/// Links visited getter for disk. This does nothing with [disk] flag enabled.
/// Links visited getter for disk. This does nothing with `disk` flag enabled.
#[cfg(feature = "disk")]
pub async fn get_links_disk(&self) -> HashSet<CaseInsensitiveString> {
if self.sqlite.pool_inited() {
Expand Down Expand Up @@ -4311,7 +4311,7 @@ impl Website {
self
}

/// Wait for idle dom mutations for target element. This method does nothing if the [chrome] feature is not enabled.
/// Wait for idle dom mutations for target element. This method does nothing if the `chrome` feature is not enabled.
pub fn with_wait_for_idle_dom(
&mut self,
wait_for_selector: Option<crate::configuration::WaitForSelector>,
Expand Down
2 changes: 1 addition & 1 deletion spider_chrome/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_chrome"
version = "2.24.12"
version = "2.24.13"
rust-version = "1.70"
authors = [
"j-mendez <jeff@spider.cloud>"
Expand Down
2 changes: 1 addition & 1 deletion spider_chrome/fetcher/src/browser/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct BrowserFetcherOptions {

/// The host that will be used for downloading.
///
/// defaults to https://storage.googleapis.com
/// defaults to <https://storage.googleapis.com>
pub(crate) host: String,

/// The path to download browsers to.
Expand Down
2 changes: 1 addition & 1 deletion spider_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_cli"
version = "2.24.12"
version = "2.24.13"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_transformations/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_transformations"
version = "2.24.12"
version = "2.24.13"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ impl<T: Debug + Eq + PartialEq + Clone + Default> TaggedLine<T> {
}

/// Iterator over TaggedLineElements
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &TaggedLineElement<T>> + 'a {
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a TaggedLineElement<T>> + 'a {
self.v.iter()
}

Expand Down
2 changes: 1 addition & 1 deletion spider_utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_utils"
version = "2.24.12"
version = "2.24.13"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down
2 changes: 1 addition & 1 deletion spider_worker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider_worker"
version = "2.24.12"
version = "2.24.13"
authors = [
"j-mendez <jeff@spider.cloud>"
]
Expand Down

0 comments on commit 076119f

Please sign in to comment.