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
52
// Sylva: LiDAR processing for forest ecology and remote sensing research.
// Copyright (C) 2026 Tim Devereux, The University of Queensland.
// Free software under the GNU General Public License v3.0 or later;
// see the LICENSE file. There is no warranty, to the extent permitted by law.
//! What can go wrong, and the message it carries.
//!
//! Every fallible function in the core returns [`Result<T>`], which is "a `T`
//! or an [`Error`]". Callers either handle it or pass it on with `?`; nothing
//! is thrown, and a failure cannot be ignored by accident. The bindings turn
//! these into Python exceptions, so the text below is what the person running
//! the command finally reads — which is why it names the file and says what
//! would make it work, rather than describing the internals.
use PathBuf;
/// A failure, in one of the handful of kinds the core distinguishes.
///
/// The `#[error(...)]` lines are the messages; `#[from]` means an error of
/// that foreign type converts into this one on its own, which is what lets a
/// function working with files write `?` after a standard library call. A
/// variant added here is handled everywhere at once, because the compiler
/// refuses any `match` that forgets it.
/// The crate's own `Result`: `Result<T>` here means `Result<T, Error>`.
pub type Result<T> = Result;