Skip to content

Commit

Permalink
feat: re-export external types from the API as part of the API
Browse files Browse the repository at this point in the history
  • Loading branch information
woshilapin authored and datanel committed Dec 12, 2023
1 parent f651ecc commit 10c35a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Hove <[email protected]>", "Guillaume Pinot <[email protected]>"]
name = "transit_model"
version = "0.58.1"
version = "0.59.0"
license = "AGPL-3.0-only"
description = "Transit data management"
repository = "https://github.com/hove-io/transit_model"
Expand Down Expand Up @@ -36,6 +36,7 @@ members = [
xmllint = ["proj"]
gtfs = []
parser = []
typed-index-collection-expose-inner = ["typed_index_collection/expose-inner"]

[dependencies]
anyhow = "1"
Expand Down
25 changes: 25 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,31 @@ pub mod validity_period;
mod version_utils;
pub mod vptranslator;

// Re-export sub-types that are part of `transit_model` API
// Useful because user won't need to depend on a third party dependency
// and find the correct version to make it work.
pub use relational_types::{IdxSet, Relation};
pub use typed_index_collection::{
Collection, CollectionWithId, Id, Idx, Iter as TypedIndexCollectionIter, WithId,
};
/// Re-export `chrono` types that are part of `transit_model` API
pub mod chrono {
pub use chrono::{DateTime, FixedOffset};
pub(crate) use chrono::{SecondsFormat, Utc};
}
/// Re-export `geo` types that are part of `transit_model` API
pub mod geo {
pub use geo::geometry::Geometry;
}
/// Re-export `minidom` types that are part of `transit_model` API
pub mod minidom {
pub use minidom::Element;
}
/// Re-export `rust_decimal` types that are part of `transit_model` API
pub mod rust_decimal {
pub use rust_decimal::Decimal;
}

// Good average size for initialization of the `StopTime` collection in `VehicleJourney`
// Note: they are shrinked down in `Model::new()` to fit the real size
pub(crate) const STOP_TIMES_INIT_CAPACITY: usize = 50;
Expand Down

0 comments on commit 10c35a7

Please sign in to comment.