pub enum SourceMapStorage {
Full(Vec<SourceMap>),
Compact(Vec<CompactSourceMap>),
None,
}Expand description
Centralized source map storage with configurable retention
Owned by SchemaSet to manage source buffers for all documents. See XSD.md (Source Buffer Storage section) for memory management.
Variants§
Full(Vec<SourceMap>)
Full source text retained (default)
Compact(Vec<CompactSourceMap>)
Text dropped; only line mapping kept
None
No source info retained
Implementations§
Source§impl SourceMapStorage
impl SourceMapStorage
Sourcepub fn add(&mut self, map: SourceMap) -> DocumentId
pub fn add(&mut self, map: SourceMap) -> DocumentId
Add a source map
Sourcepub fn locate(&self, source_ref: &SourceRef) -> Option<SourceLocation>
pub fn locate(&self, source_ref: &SourceRef) -> Option<SourceLocation>
Resolve SourceRef to SourceLocation
Sourcepub fn get_text(&self, doc_id: DocumentId, span: &SourceSpan) -> Option<&str>
pub fn get_text(&self, doc_id: DocumentId, span: &SourceSpan) -> Option<&str>
Get source text slice for XmlFragment (requires Full mode)
Sourcepub fn compact(&mut self)
pub fn compact(&mut self)
Compact storage by dropping source text (Full -> Compact)
Saves ~90% memory but loses ability to extract source text spans.
Trait Implementations§
Source§impl Debug for SourceMapStorage
impl Debug for SourceMapStorage
Source§impl Default for SourceMapStorage
impl Default for SourceMapStorage
Source§fn default() -> SourceMapStorage
fn default() -> SourceMapStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SourceMapStorage
impl RefUnwindSafe for SourceMapStorage
impl Send for SourceMapStorage
impl Sync for SourceMapStorage
impl Unpin for SourceMapStorage
impl UnsafeUnpin for SourceMapStorage
impl UnwindSafe for SourceMapStorage
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