Expand description
Safe Rust binding for the MapLibre Native C API.
This crate owns Rust-specific ergonomics and safety policy: thread-affine
public handles, parent retention, owner-thread Drop, Rust errors,
callback closure APIs, and lifetime-scoped render resources. Shared C ABI
adaptation lives in maplibre-native-ffi-core.
Structs§
- Animation
Options - Optional animation controls for camera transitions.
- Bound
Options - Optional map camera constraint fields.
- Byte
Range - Byte range requested for a network resource.
- Camera
FitOptions - Optional fitting controls for camera-for-viewport queries.
- Camera
Options - Camera fields used for snapshots and camera commands.
- Camera
Transition Finished Event - Camera transition-finished event payload.
- Canonical
Tile Id - Canonical tile identity used by custom geometry source callbacks.
- Custom
Geometry Source Options - Options used when adding a custom geometry source.
- Detached
Render Session Handle - Render session after backend resources have been detached.
- Edge
Insets - Screen-space inset in logical map pixels.
- EglContext
Descriptor - Error
- Feature
State Selector - Source, feature, and state-key selector for render-session feature state.
- Frame
Native Pointer - Borrowed opaque native address whose validity is tied to an active texture frame. It does not own, retain, dereference, or validate the pointed-to object.
- Frame
OpenGL Texture Name - Borrowed OpenGL texture object name tied to an active texture frame.
- Free
Camera Options - Free camera position and orientation in MapLibre Native camera space.
- GeoJson
Source Data Handle - Owned handle for prepared GeoJSON source data.
- GeoJson
Source Options - Options for GeoJSON sources. Fixed when the source is created; updating the source’s URL or data keeps the options it was added with.
- Handle
Operation Error - Error returned by consuming one-shot handle operations when the handle remains live and the operation can be retried.
- Http
Header - One owned outgoing HTTP request header.
- Http
Header Transform Request - Copied request passed to an outgoing HTTP header transform callback.
- Image
Content - Content-box insets in image pixels, measured from the image’s top-left.
- Image
Stretch - One stretchable interval along an image axis, in image pixels.
- LatLng
- Geographic coordinate in degrees.
- LatLng
Bounds - Geographic bounds in degrees.
- LogRecord
- Copied MapLibre Native log record.
- LogSeverity
Mask - Mask of log severities that MapLibre Native may dispatch asynchronously.
- MapAttach
Ref - A reference to a map for the sole purpose of attaching a render session,
produced by
MapHandle::attach_ref. Attaching is the one map operation that runs on the render session’s thread instead of the map’s. - MapDebug
Options - MapLibre debug overlay mask bits.
- MapHandle
- Owner-thread map handle bound to a retained runtime.
- MapId
- Identity for a map owned by a runtime. The value is the map’s native handle,
which names one map for the life of the process. It carries no ownership;
map operations go through
MapHandle. - MapOptions
- Options used when creating a map.
- MapProjection
Handle - Standalone projection snapshot created from a map transform.
- MapTile
Options - Tile prefetch and LOD tuning controls.
- MapViewport
Options - Live map viewport and render-transform controls.
- Metal
Borrowed Texture Descriptor - Metal
Context Descriptor - Metal
Owned Texture Descriptor - Metal
Owned Texture Frame - Copied metadata for an acquired Metal session-owned texture frame.
- Metal
Owned Texture Frame Handle - RAII guard for an acquired Metal session-owned texture frame.
- Metal
Surface Descriptor - Native
Handle Leak - A native handle a destructor attempted to destroy and could not. The handle stays live.
- Native
Pointer - Borrowed opaque native address used for backend interop handles. It does not own, retain, dereference, or validate the pointed-to object, and passing it to MapLibre Native transfers no ownership.
- Offline
Operation Completed Event - Offline operation-completion event payload.
- Offline
Operation Handle - Owner-thread offline database operation token that must be taken or discarded.
- Offline
Region Info - Offline region snapshot copied from native storage.
- Offline
Region Response Error Event - Offline region response-error event payload.
- Offline
Region Status - Offline region status copied from native event payloads.
- Offline
Region Status Event - Offline region status-change event payload.
- Offline
Region Tile Count Limit Event - Offline region tile-count-limit event payload.
- OpenGL
Borrowed Texture Descriptor - OpenGL
Context Provider Mask - OpenGL context providers compiled into the linked native library.
- OpenGL
Owned Texture Descriptor - OpenGL
Owned Texture Frame - Copied metadata for an acquired OpenGL session-owned texture frame.
- OpenGL
Owned Texture Frame Handle - RAII guard for an acquired OpenGL session-owned texture frame.
- OpenGL
Surface Descriptor - Premultiplied
Rgba8 Image - Projected
Meters - Lower-level Spherical Mercator projected-meter coordinate.
- Projection
Mode - Axonometric rendering options for the live map render transform.
- Quaternion
- Quaternion stored as x, y, z, w components.
- Queried
Feature - One copied feature query hit.
- Render
Backend Mask - Render backends compiled into the linked native library.
- Render
Frame Event - Render-frame event payload.
- Render
MapEvent - Render-map event payload.
- Render
Session Handle - Render session handle bound to the thread that attached it.
- Render
Target Extent - Render
Update - Outcome of a successful
RenderSessionHandle::render_updatecall. - Rendered
Feature Query Options - Options for rendered feature queries.
- Rendering
Stats - Rendering statistics copied from a render-frame event payload.
- Resource
Request - Copied request passed to a runtime-scoped resource provider callback.
- Resource
Request Handle - Owned handle for a resource provider request selected for handling.
- Resource
Response - Response used to complete a handled resource request.
- Resource
Transform Request - Copied request passed to a runtime-scoped resource transform callback.
- Runtime
Event - Owned runtime event copied out of a drained batch.
- Runtime
Event Batch - Batch of runtime events borrowed from runtime-owned storage.
- Runtime
Event Mask - Event types a map or a runtime queues.
- Runtime
Event Ref - One event of a
RuntimeEventBatch, read from runtime-owned storage. - Runtime
Handle - Owner-thread runtime handle for MapLibre Native work and event draining.
- Runtime
Options - Options used when creating a runtime.
- Screen
Box - Screen-space box in logical map pixels. Corners may be given in any order and may extend past the viewport; rendered queries normalize and clip them.
- Screen
Point - Screen-space point in logical map pixels.
- Source
Feature Query Options - Options for source feature queries.
- Source
Info - Copied retained metadata for one style source.
- Style
Image - Copied runtime style image pixels with style-specific metadata.
- Style
Image Info - Copied fixed metadata for one runtime style image.
- Style
Image Options - Options for adding or replacing a runtime style image.
- Style
Transition Options - The style’s global transition options, controlling how paint property changes animate and whether symbol placement changes cross-fade.
- Texture
Image Info - Tile
Action Event - Tile-action event payload. The event message carries the source ID.
- TileId
- Overscaled tile identity copied from a tile event payload.
- Tile
Json Info - Copied fields from an inline TileJSON source description.
- Tile
Source Options - Options for vector, raster, and raster DEM tile sources.
- Unit
Bezier - Cubic easing curve for animated camera transitions.
- Unknown
Runtime Event Payload - Payload of a type this version does not define, preserved for forward compatibility.
- Vec3
- Three-component vector used by free camera options.
- Vulkan
Borrowed Texture Descriptor - Vulkan
Context Descriptor - Vulkan
Owned Texture Descriptor - Vulkan
Owned Texture Frame - Copied metadata for an acquired Vulkan session-owned texture frame.
- Vulkan
Owned Texture Frame Handle - RAII guard for an acquired Vulkan session-owned texture frame.
- Vulkan
Surface Descriptor - Wake
Source - Releases a runtime owner thread parked in
RuntimeHandle::pump. - WebGl
Context Descriptor - Browser WebGL context a session renders into.
- WebGpu
Borrowed Texture Descriptor - WebGpu
Context Descriptor - Browser WebGPU device a session renders with.
- WebGpu
Owned Texture Descriptor - WebGpu
Owned Texture Frame - Copied metadata for an acquired WebGPU session-owned texture frame.
- WebGpu
Owned Texture Frame Handle - RAII guard for an acquired WebGPU session-owned texture frame.
- WebGpu
Surface Descriptor - WebGPU native surface session attachment options.
- WglContext
Descriptor
Enums§
- Ambient
Cache Operation - Ambient cache maintenance operation for a runtime.
- Bounds
Constraint - Geographic constraint applied to the map camera center.
- Camera
Change Mode - Camera change kind carried in the
codeof camera will-change and did-change events. Decode it withCameraChangeMode::from_raw(event.code as u32). - Constrain
Mode - Map constraint modes used by viewport options.
- Error
Kind - Location
Indicator Image Kind - Image-name property slots for location indicator layers.
- LogEvent
- Category for a MapLibre Native log record.
- LogSeverity
- Severity for a MapLibre Native log record.
- MapMode
- Map rendering mode used when creating a map.
- Network
Status - Process-global network reachability state used by MapLibre Native.
- North
Orientation - Map north orientation values used by viewport options.
- Offline
Operation Kind - Offline database operation kind reported by completion events.
- Offline
Operation Result Kind - Offline database operation result kind reported by completion events.
- Offline
Operation Take Error - Error returned by offline operation result transfers.
- Offline
Region Definition - Region descriptor used to create or inspect offline regions.
- Offline
Region Download State - Offline region download state copied from event payloads.
- OpenGL
Client Api - OpenGL client API a dedicated EGL session creates its context for.
- OpenGL
Context Descriptor - OpenGL platform context a render session draws through.
- OpenGL
Context Ownership - How a session’s OpenGL context relates to the thread that attached it.
- Raster
DemEncoding - DEM raster encoding for raster DEM style sources.
- Render
Mode - Render mode reported by render observer events.
- Render
Result - Outcome of a successful render-update call.
- Rendered
Query Geometry - Screen-space geometry used for rendered feature queries.
- Resource
Error Reason - Resource error reason copied from event payloads and used in resource responses.
- Resource
Kind - Network resource kind passed to resource callbacks.
- Resource
Loading Method - Resource loading method requested by MapLibre Native.
- Resource
Priority - Resource request priority.
- Resource
Provider Decision - Decision returned by a resource provider callback.
- Resource
Response Status - Status for a resource provider response.
- Resource
Storage Policy - Resource cache storage policy.
- Resource
Usage - Resource request usage.
- Runtime
Event Payload - Event payload decoded from the payload union that every event carries.
- Runtime
Event Source - Source object that emitted a runtime event.
- Runtime
Event Type - Runtime event type.
- Source
Type - Style source type values returned by native style source metadata.
- Style
Image Text Fit - How a stretchable style image fits text along one axis.
- Style
Layer Visibility - Whether a style layer draws.
- Tile
LodMode - Tile LOD algorithms used by map tile options.
- Tile
Operation - Tile operation reported by tile observer events.
- Tile
Scheme - Tile URL coordinate scheme for vector, raster, and raster DEM sources.
- Vector
Tile Encoding - Vector tile encoding for vector style sources.
- Viewport
Mode - Viewport orientation modes used by viewport options.
Functions§
- c_
version - Returns the native C ABI contract version.
- clear_
log_ callback - Clears the process-global MapLibre Native log callback.
- lat_
lng_ for_ projected_ meters - Converts Spherical Mercator projected meters to a geographic coordinate.
- network_
status - Reads MapLibre Native’s process-global network status.
- projected_
meters_ for_ lat_ lng - Converts a geographic coordinate to Spherical Mercator projected meters.
- set_
async_ log_ severity_ mask - Configures severities that MapLibre Native may dispatch asynchronously.
- set_
leak_ reporter - Installs the process-wide reporter for handles a destructor could not
destroy, replacing any previous one, and returns whether one was installed.
Explicit
closereports the same failure through the normal error path. - set_
log_ callback - Installs or replaces the process-global MapLibre Native log callback.
- set_
network_ status - Sets MapLibre Native’s process-global network status.
- supported_
opengl_ context_ providers - Returns the OpenGL context providers compiled into the linked native library.
- supported_
render_ backends - Returns the render backends compiled into the linked native library.