pub struct EntityDecoder<'a> { /* private fields */ }Expand description
Entity decoder for lazy parsing - uses Arc for efficient cache sharing
Implementations§
Source§impl<'a> EntityDecoder<'a>
impl<'a> EntityDecoder<'a>
Sourcepub fn with_index(content: &'a str, index: EntityIndex) -> Self
pub fn with_index(content: &'a str, index: EntityIndex) -> Self
Create decoder with pre-built index (faster for repeated lookups)
Sourcepub fn decode_at(&mut self, start: usize, end: usize) -> Result<DecodedEntity>
pub fn decode_at(&mut self, start: usize, end: usize) -> Result<DecodedEntity>
Decode entity at byte offset Returns cached entity if already decoded
Sourcepub fn decode_by_id(&mut self, entity_id: u32) -> Result<DecodedEntity>
pub fn decode_by_id(&mut self, entity_id: u32) -> Result<DecodedEntity>
Decode entity by ID - O(1) lookup using entity index
Sourcepub fn resolve_ref(
&mut self,
attr: &AttributeValue,
) -> Result<Option<DecodedEntity>>
pub fn resolve_ref( &mut self, attr: &AttributeValue, ) -> Result<Option<DecodedEntity>>
Resolve entity reference (follow #ID) Returns None for null/derived values
Sourcepub fn resolve_ref_list(
&mut self,
attr: &AttributeValue,
) -> Result<Vec<DecodedEntity>>
pub fn resolve_ref_list( &mut self, attr: &AttributeValue, ) -> Result<Vec<DecodedEntity>>
Resolve list of entity references
Sourcepub fn get_cached(&self, entity_id: u32) -> Option<DecodedEntity>
pub fn get_cached(&self, entity_id: u32) -> Option<DecodedEntity>
Get cached entity (without decoding)
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear cache to free memory
Sourcepub fn cache_size(&self) -> usize
pub fn cache_size(&self) -> usize
Get cache size
Sourcepub fn get_raw_bytes(&mut self, entity_id: u32) -> Option<&'a [u8]>
pub fn get_raw_bytes(&mut self, entity_id: u32) -> Option<&'a [u8]>
Get raw bytes for an entity (for direct/fast parsing) Returns the full entity line including type and attributes
Sourcepub fn get_raw_content(&mut self, entity_id: u32) -> Option<&'a str>
pub fn get_raw_content(&mut self, entity_id: u32) -> Option<&'a str>
Get raw content string for an entity
Sourcepub fn get_entity_ref_list_fast(&mut self, entity_id: u32) -> Option<Vec<u32>>
pub fn get_entity_ref_list_fast(&mut self, entity_id: u32) -> Option<Vec<u32>>
Fast extraction of entity reference IDs from a list attribute in raw bytes Useful for getting face list from ClosedShell, bounds from Face, etc. Returns list of entity IDs
Sourcepub fn get_polyloop_point_ids_fast(
&mut self,
entity_id: u32,
) -> Option<Vec<u32>>
pub fn get_polyloop_point_ids_fast( &mut self, entity_id: u32, ) -> Option<Vec<u32>>
Fast extraction of PolyLoop point IDs directly from raw bytes Bypasses full entity decoding for BREP optimization Returns list of entity IDs for CartesianPoints