chore: expose lib target + open-path profiling examples
Examples can't import from a bin-only crate, so add a thin lib.rs that re-exports the existing modules. Used by the new examples that helped diagnose the freeze fixed in the previous commit. - examples/time_open: times parse / purge / cache / first-wires phases - examples/inspect_insert: lists Insert blocks with sub-entity counts - examples/find_raster: dumps RasterImage path + dimensions Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
c61d648dc7
commit
03555ce8bd
4 changed files with 154 additions and 0 deletions
14
examples/find_raster.rs
Normal file
14
examples/find_raster.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use acadrust::entities::EntityType;
|
||||
use acadrust::io::dwg::DwgReader;
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let path = std::env::args().nth(1).unwrap();
|
||||
let doc = DwgReader::from_file(&path)?.read()?;
|
||||
for e in doc.entities() {
|
||||
if let EntityType::RasterImage(img) = e {
|
||||
println!("file_path: {}", img.file_path);
|
||||
println!("size: {} x {}", img.size.x, img.size.y);
|
||||
if let Ok(meta) = std::fs::metadata(&img.file_path) { println!("disk size: {} bytes", meta.len()); }
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Loading…
Reference in a new issue