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
//! Crate-private getters Swift reads value types through, and the setters it
//! fills them with.
//!
//! Each getter lends what the value holds, so Swift's copy is the only one.
//! Swift calls each by its `swift_name` in `bridge::ffi`, Rust's in camel case.
//! Shapes swift-bridge can't return become sets: optional nested value →
//! `has_x` + `x`; list → `x_len` + `x_at`; map → length + key and value at an
//! index; enum → kind + payload. Swift asks for an index only below the length.
//!
//! Swift never makes a Rust value: it fills one Rust hands it, clearing and
//! pushing what it holds, so it can hand back a configuration it seeded. (A
//! Rust function returning one to Swift gets a redundant cast in
//! swift-bridge's glue.)
use BTreeMap;
use Path;
/// The `index`th entry of a sorted map.