pub struct InternedBpsvDocument { /* private fields */ }Expand description
A BPSV document that uses string interning to reduce memory usage
This is particularly effective for config files where the same values appear repeatedly across rows (e.g., region codes, server names, etc.)
Implementations§
Source§impl InternedBpsvDocument
impl InternedBpsvDocument
Sourcepub fn from_document(doc: BpsvDocument<'_>) -> Self
pub fn from_document(doc: BpsvDocument<'_>) -> Self
Create a new interned document from a regular document
Sourcepub fn parse(data: &str) -> Result<Self>
pub fn parse(data: &str) -> Result<Self>
Parse and create an interned document directly from BPSV data
Sourcepub fn schema(&self) -> &BpsvSchema
pub fn schema(&self) -> &BpsvSchema
Get the schema
Sourcepub fn rows(&self) -> &[InternedRow]
pub fn rows(&self) -> &[InternedRow]
Get all rows
Sourcepub fn sequence_number(&self) -> Option<u32>
pub fn sequence_number(&self) -> Option<u32>
Get the sequence number
Sourcepub fn memory_stats(&self) -> MemoryStats
pub fn memory_stats(&self) -> MemoryStats
Get memory statistics for this document
Sourcepub fn interner_hit_rate(&self) -> f64
pub fn interner_hit_rate(&self) -> f64
Get the interner hit rate
Sourcepub fn find_rows(&self, field_name: &str, value: &str) -> Vec<&InternedRow>
pub fn find_rows(&self, field_name: &str, value: &str) -> Vec<&InternedRow>
Find rows where a field matches a value
Sourcepub fn get_row(&self, index: usize) -> Option<&InternedRow>
pub fn get_row(&self, index: usize) -> Option<&InternedRow>
Get a specific row by index
Trait Implementations§
Source§impl Clone for InternedBpsvDocument
impl Clone for InternedBpsvDocument
Source§fn clone(&self) -> InternedBpsvDocument
fn clone(&self) -> InternedBpsvDocument
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for InternedBpsvDocument
impl !UnwindSafe for InternedBpsvDocument
impl Freeze for InternedBpsvDocument
impl Send for InternedBpsvDocument
impl Sync for InternedBpsvDocument
impl Unpin for InternedBpsvDocument
impl UnsafeUnpin for InternedBpsvDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more