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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! [`IntoLocalError<H>`]: the error a fallible `Foreign*::into_local` returns.
use ;
use impl_source_error;
/// The error [`ForeignOwned::into_local`](crate::ForeignOwned::into_local) /
/// [`ForeignRc::into_local`](crate::ForeignRc::into_local) /
/// [`ForeignWeak::into_local`](crate::ForeignWeak::into_local) returns.
///
/// `into_local` **consumes** the foreign handle to resolve it to an in-file handle. A
/// bare `io::Result` would drop that handle on failure — and because a `Foreign*` handle
/// has no `Drop` (release is explicit, via `bstack_drop` / `into_foreign`), the
/// transferred reference (a strong/weak count, or a whole owned block) would become an
/// unreachable orphan. So a failed `into_local` hands the original handle back in
/// [`handle`](Self::handle), intact — its reference was never released — the same
/// hand-back contract as [`ReplaceError`](crate::ReplaceError) /
/// [`ConstructError`](crate::ConstructError). Recover it with
/// [`into_handle`](Self::into_handle): re-store it, resolve it against the correct file,
/// or `bstack_drop` it. Like the other hand-back errors it carries no
/// `From<IntoLocalError> for io::Error`, so a caller cannot `?` it and silently drop the
/// handle.
///
/// Implements [`std::error::Error`] (delegating [`Display`](fmt::Display) to
/// [`source`](Self::source)).
// Manual, so `H` (a foreign handle) need not be `Debug`.
impl_source_error!;