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
// Rust-backed FileSource bridge.
//
// Installs an `mbgl::FileSource` factory for `FileSourceType::ResourceLoader`
// that delegates every resource request to a Rust closure. This replaces the
// default ResourceLoader (which composes Asset/Database/Network/Mbtiles/Pmtiles
// sources) with a single Rust-supplied handler — letting callers serve
// mbtiles://, file://, and custom schemes from Rust without running a sidecar
// HTTP server or pre-extracting tiles.
//
// Factory registration is process-global (mbgl::FileSourceManager is a
// singleton). Call `register_rust_file_source_factory` once before any
// `mbgl::Map` is constructed.
//
// `FileSourceManager` *also* caches FileSource instances by `(type,
// ResourceOptions)`; `registerFileSourceFactory` only swaps the factory
// slot and never evicts the cache. A subsequent call therefore takes
// effect only for `Map`s constructed with `ResourceOptions` that don't
// already have a live cached FileSource — in practice, only after every
// previously built renderer has been dropped, or by varying
// `ResourceOptions` (e.g. a unique `platformContext`) per renderer. Two
// concurrent renderers with different callbacks are not supported by
// this layer.
namespace mln // namespace mln