Skip to main content

mln_engine/
lib.rs

1//! The map engine: the map and camera (`map`, `camera`, `gestures`),
2//! renderer and frames (`render`, `draw`), sources (`source`), tiles and
3//! workers (`tile`, `tile_store`, `worker`), layers' layouts and buckets
4//! (`layer`), placement, queries, text/images, and storage/offline caching.
5
6#![warn(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
7#![cfg_attr(not(test), warn(clippy::unreachable, clippy::print_stdout, clippy::print_stderr))]
8
9#[cfg(feature = "bench")]
10#[doc(hidden)]
11pub mod bench;
12pub mod camera;
13pub mod draw;
14pub mod exec;
15pub mod geo;
16pub mod gestures;
17pub mod image;
18pub mod layer;
19pub mod map;
20mod map_mode;
21#[cfg(feature = "sqlite")]
22pub mod offline;
23pub mod placement;
24pub mod plugin;
25pub mod query;
26mod registry;
27pub(crate) mod render;
28// Each layer type's programs and the engine's, public for the backends'
29// tests, which compile them. Not API.
30#[doc(hidden)]
31pub mod shaders;
32pub mod source;
33pub mod storage;
34pub mod text;
35pub mod tile;
36pub mod tile_store;
37pub mod worker;
38
39pub use map_mode::MapMode;
40pub use registry::{Registry, RegistryBuilder, register_builtin_projections};
41pub use render::events::{
42    FontStack, GlyphRange, RenderMode, RendererEvent, RendererEvents, RenderingStats, TileOperation,
43};
44pub use render::renderer::{DrawnFrame, RenderTimings, Renderer, UpdatedFrame};
45pub use render::update_parameters::UpdateParameters;
46pub use render::update_slot::{Update, UpdateReader, UpdateSlot};
47
48/// What the expansions of the crate's macros and of `#[derive(Wire)]` name,
49/// so that a crate that invokes them needn't depend on it.
50#[doc(hidden)]
51pub mod __private {
52    pub use mln_gfx;
53    pub use mln_style;
54    pub use mln_wire;
55}
56
57/// The `tracing` targets of this crate's events. Each names the event that
58/// `mln_c` reports it under (`mln_c::logging`).
59mod log_target {
60    pub(crate) const GENERAL: &str = "mln_engine::general";
61    #[cfg_attr(not(feature = "sqlite"), expect(dead_code, reason = "only the database logs"))]
62    pub(crate) const DATABASE: &str = "mln_engine::database";
63    pub(crate) const HTTP_REQUEST: &str = "mln_engine::http_request";
64    pub(crate) const PARSE_TILE: &str = "mln_engine::parse_tile";
65    pub(crate) const SPRITE: &str = "mln_engine::sprite";
66    pub(crate) const SETUP: &str = "mln_engine::setup";
67    pub(crate) const PARSE_STYLE: &str = "mln_engine::parse_style";
68    pub(crate) const RENDER: &str = "mln_engine::render";
69    pub(crate) const STYLE: &str = "mln_engine::style";
70    pub(crate) const GLYPH: &str = "mln_engine::glyph";
71    pub(crate) const TIMING: &str = "mln_engine::timing";
72}
73
74// The tests' copy of mln_builtins' source types names this crate as its
75// dependents do.
76#[cfg(test)]
77extern crate self as mln_engine;
78
79#[cfg(test)]
80mod tests;