mln-rs 0.0.21

A MapLibre map renderer written in Rust
Documentation
//! A MapLibre map renderer written in Rust.
//!
//! The root holds the thread-safe handles of `mln_runtime`: a [`Runtime`]
//! and its [`Map`]s, whose commands run on the runtime's thread and report
//! through a [`Completion`], and the [`RenderSession`]s that draw them.
//!
//! The library crates of <https://github.com/maplibre/mln-rs> are re-exported
//! here under their crate names: `mln_rs::mln_engine`, `mln_rs::mln_style`,
//! `mln_rs::mln_builtins`, and so on. They are published as the `mln-rs-*`
//! packages, which only exist for this crate. The tile worker codec's
//! encoding (`mln_wire`) is internal to mln-rs: [`layer`] re-exports only
//! what a layer type's buckets implement, the `Wire` trait and its derive,
//! with its `Reader` and `Writer`.
//!
//! The library logs through `tracing` and installs no subscriber: install
//! one, such as `tracing-subscriber`'s, to read its events. An event's target
//! is `<crate>::<event>`, where the event says what logged it, as the C API's
//! log events do: `mln_style::parse_style`, `mln_engine::database`,
//! `mln_vulkan::render`. The offline database's errors carry their SQLite or
//! I/O error code in a `code` field. An event is a static message plus named
//! fields, such as `source_id` or `error`, for a subscriber to filter and
//! format. wgpu and naga log through `log`; a
//! subscriber reads their records with `tracing-log`'s `LogTracer`.
//!
//! A crate that adds a layer type or a source type writes it with what
//! [`layer`] and [`source`] gather from those crates, and registers it in
//! the [`RegistryBuilder`](layer::RegistryBuilder) of the map's
//! [`Registry`](layer::Registry) ([`Runtime::with_registry`]).
//!
//! GeoJSON is the `geojson` crate's and feature geometry is `geo_types`'.
//! Both crates are re-exported.
//!
//! Each backend is a feature, which re-exports its crate: `metal`
//! (`mln_mtl`), `vulkan` (`mln_vulkan`), `d3d12` (`mln_d3d12`), `gl`
//! (`mln_gl`) and `webgpu` (`mln_webgpu`). All but `webgpu` are on by
//! default; natively, wgpu renders through the same APIs as the others, so
//! turn it on to share a wgpu device or surface with the map.

pub use geo_types;
pub use geojson;
pub use geometry;
pub use glam;
pub mod layer;
pub use mln_builtins;
/// Empty except on Windows.
#[cfg(feature = "d3d12")]
pub use mln_d3d12;
pub use mln_engine;
pub use mln_gfx;
#[cfg(feature = "gl")]
pub use mln_gl;
/// Empty except on Apple platforms.
#[cfg(feature = "metal")]
pub use mln_mtl;
// Every runtime type is at the root, so the root can't miss one that a
// root type's methods take or return.
pub use mln_runtime::{self, *};
pub use mln_style;
/// Empty on Apple platforms and in the browser build.
#[cfg(feature = "vulkan")]
pub use mln_vulkan;
#[cfg(feature = "webgpu")]
pub use mln_webgpu;
pub mod source;