Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contributing Conventions — Rustic Maps SDK

The project guides set the repository’s behavioral rules. This document translates them into per-language practice, including the generated binding surfaces.

1. No abbreviations in public identifiers

Every public identifier is spelled out, and stays concise yet precise:

GoodBad
GeographicCoordinateGeoCoord
RouteStepRStep
instruction_display_textinstrDispTxt
fetch_traffic_incidentsfetchTI
time_to_live_secondsttl

The standard forms SDK, URL, HTTP, wasm, and MVT are accepted in documentation text, but never as identifier shorthand.

2. SOLID mapping

PrincipleRust coreKotlin binding surfaceSwift binding surface
Single responsibilityone crate per concernone class per screen/featureone struct per screen/feature
Open–closeda new vendor means a new *Provider impl; the core stays untoucheda new capability means a new composable or view-modelfinal class + protocol; no forks in existing code
Liskov substitutionmocks in geospatial-traits::mock must satisfy every tested consumersubclasses and refapps honor suspend contractsSwiftUI view models honor async throws contracts
Interface segregationten narrow contracts, not one mega-traitexpose role-targeted protocols, not god objectsrole-targeted protocols
Dependency inversioncrates depend on geospatial-traits, never on a providerview models depend on injected SDK protocolsdependency injection through initializers

3. Errors

  • Rust: every failure is geospatial_types::SDKError. Crate code uses no unwrap, no expect, and no raw String errors, and panics never cross the FFI boundary.
  • Kotlin: UniFFI maps the UDL contract to typed exceptions, and the refapps surface them as sealed UI states.
  • Swift: UniFFI maps the contract to typed Swift errors thrown from async methods.

4. Property- and fixture-first testing

  • Coordinate, camera, and projection math gets proptest suites.
  • Every external payload gets a recorded fixture and a parser test.
  • Reference applications double as UI-test hosts (Espresso / XCUITest / Detox).