Datapath: type-safe structured paths
Provides simple macros and utilities for type-safe structured paths. This is intended for use with S3 and duckdb hive partitions, or simple S3 paths for lancedb.
Basic Usage
use ;
use Uuid;
/// Define a datapath pattern
datapath!
// Create a datapath instance
let path = CaptureRaw ;
println!; // "capture/user_id=<uuid>/ts=1234567890/raw/2.0"
let file = path.with_file;
println!; // "capture/user_id=<uuid>/ts=1234567890/raw/2.0/data.json"
let parsed = parse;
match parsed
Schema Associations
Associate datapaths with schema types for type-safe data handling:
use datapath;
datapath!
// EventPath now implements SchemaDatapath
// EventPath::Schema == UserEvent
Examples
use datapath;
;
datapath!