1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Errors from article extraction.
use Error;
/// Errors from article extraction.
///
/// [`parse()`](crate::parse) and [`Document::parse`](crate::Document::parse) return these
/// errors.
///
/// # Example
///
/// ```rust
/// use legible::{Error, parse};
///
/// match parse("<html><body></body></html>", None, None) {
/// Ok(article) => println!("Title: {}", article.title),
/// Err(Error::NoContent) => println!("The document has no article content."),
/// Err(Error::NoBody) => println!("The document has no body."),
/// Err(error) => println!("Extraction error: {error}"),
/// }
/// ```
/// A result from article extraction.
pub type Result<T> = Result;