Crate lychee_lib[−][src]
lychee
is a library for checking links.
“Hello world” example:
use lychee_lib::Result; #[tokio::main] async fn main() -> Result<()> { let response = lychee_lib::check("https://github.com/lycheeverse/lychee").await?; println!("{}", response); Ok(()) }
For more specific use-cases you can build a lychee client yourself,
using the ClientBuilder
which can be used to
configure and run your own link checker and grants full flexibility:
use lychee_lib::{ClientBuilder, Result, Status}; #[tokio::main] async fn main() -> Result<()> { let client = ClientBuilder::default().build()?; let response = client.check("https://github.com/lycheeverse/lychee").await?; assert!(response.status().is_success()); Ok(()) }
Re-exports
pub use crate::collector::Input; |
pub use crate::filter::Filter; |
Modules
collector | |
extract | |
filter |
Structs
ClientBuilder | Builder for |
ClientPool | |
Excludes | Exclude configuration for the link checker. You can ignore links based on regex patterns or pre-defined IP ranges. |
Includes | Include configuration for the link checker. You can include links based on regex patterns |
Request | |
Response | |
ResponseBody | |
Uri | Lychee’s own representation of a URI, which encapsulates all support formats. |
Enums
ErrorKind | Kinds of status errors. |
Status | Response status of the request. |
Functions
check | A convenience function to check a single URI
This is the most simple link check and avoids having to create a client manually.
For more complex scenarios, look into using the |
Type Definitions
Result |