cjseq/lib.rs
1//! `cjseq2` is a typed fork of [`cjseq`](https://github.com/cityjson/cjseq),
2//! for reading, writing, and converting between CityJSON and CityJSONSeq.
3//!
4//! The library crate is still named `cjseq` (see `Cargo.toml`'s `[lib]`
5//! section), so existing code that does `use cjseq::CityJSON` keeps working
6//! unchanged. The package itself is published as `cjseq2` pending an
7//! eventual merge upstream.
8//!
9//! Internally the crate is organised into one module per concern:
10//! - `geometry` — `Geometry`, `GeometryType`, `GeometryTemplates`
11//! - `semantics` — `Semantics`, `SemanticsSurface`, `SemanticsValues`
12//! - `appearance` — `Appearance`, `MaterialReference`, `MaterialValues`, `TextureReference`, `TextureValues`
13//! - `city_object` — `CityObject`
14//! - `metadata` — `Metadata`, `PointOfContact`, `Address`, `ReferenceSystem`, `Transform`, `GeographicalExtent`
15//! - `error` — `CjseqError`, `Result`
16//! - `cityjson` — `CityJSON`, `CityJSONFeature`, `SortingStrategy`, and the sequencing/collect/filter logic
17//!
18//! Every type is re-exported at the crate root, so the module boundaries
19//! above are an internal organisational detail, not part of the public
20//! import paths. The one exception is the `Result<T>` alias, which stays at
21//! [`error::Result`] so that a glob `use cjseq::*` cannot shadow
22//! `std::result::Result`.
23
24mod appearance;
25mod city_object;
26mod cityjson;
27pub mod error;
28mod geometry;
29mod metadata;
30mod semantics;
31
32pub use appearance::*;
33pub use city_object::*;
34pub use cityjson::*;
35//-- Deliberately *not* `pub use error::*`. That would put a `Result<T>` alias
36//-- at the crate root, and `use cjseq::*` would then shadow
37//-- `std::result::Result` in the importing module -- a surprise this crate has
38//-- no business inflicting on its callers. `CjseqError` is re-exported by
39//-- name; the alias stays reachable as `cjseq::error::Result`.
40pub use error::CjseqError;
41pub use geometry::*;
42pub use metadata::*;
43pub use semantics::*;
44
45// WASM bindings module
46#[cfg(target_arch = "wasm32")]
47pub mod wasm;
48
49// Re-export WASM functions for convenience
50#[cfg(target_arch = "wasm32")]
51pub use wasm::*;