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
//! The public error type for the `text-document` API.
//!
//! Every fallible public function returns [`Result<T>`], i.e.
//! `Result<T, DocumentError>`. Unlike the previous opaque
//! `anyhow::Result`, callers can now match on [`DocumentError`] to react
//! to specific failure categories (a cursor used outside a table, a
//! lookup that found nothing, an out-of-range index, …).
//!
//! Errors originating deep inside the backend crates arrive as
//! [`DocumentError::Internal`] via the `From<anyhow::Error>` bridge, so
//! propagation with `?` continues to work unchanged.
use Error;
/// Errors returned by the public `text-document` API.
///
/// The `Display` text is the original human-readable message; the variant
/// carries the machine-matchable category. Marked `#[non_exhaustive]` so
/// new categories can be added without breaking callers — match with a
/// `_` arm.
/// Result alias used throughout the public API.
pub type Result<T> = Result;