gistools/writers/
mod.rs

1/// Write (S2|Geo)JSON to a file
2pub mod json;
3/// The (S2)PMTiles Writer
4pub mod pmtiles;
5/// S2 Tiles Writer
6pub mod s2tiles;
7/// Tile based writers
8pub mod tile;
9/// To Tiles Writer
10pub mod to_tiles;
11
12pub use json::*;
13pub use pmtiles::*;
14use s2json::VectorFeature;
15pub use s2tiles::*;
16pub use tile::*;
17pub use to_tiles::*;
18
19/// Before using the data, you can mutate it here. It can also act as a filter if you return None
20pub type OnFeature<M, P, D> = fn(feature: VectorFeature<M, P, D>) -> Option<VectorFeature<M, P, D>>;
21
22/// Specify a trait that defines OnFeature but ensures its thread safe
23/// A feature reader trait with a callback-based approach
24pub trait OnFeatureMethod<M: Clone, P: Clone + Default, D: Clone + Default> {
25    /// Reads features and applies the given callback function to each feature.
26    fn on_feature<F>(&mut self, callback: F)
27    where
28        F: FnMut(VectorFeature<M, P, D>) -> Option<VectorFeature<M, P, D>> + Send + Sync;
29}