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().client()?;
  let response = client.check("https://github.com/lycheeverse/lychee").await?;
  assert!(response.status().is_success());
  Ok(())
}

Modules

collector
extract
filter

Structs

ClientBuilder

A link checker using an API token for Github links otherwise a normal HTTP client.

ClientPool
Excludes

Exclude configuration for the link checker. You can ignore links based on regex patterns.

Filter

A generic URI filter Used to decide if a given URI should be checked or skipped

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.

Input

Links which need to be validated.

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 ClientBuilder instead.

Type Definitions

Result