pub struct BuildContext {
pub interner: StringInterner,
pub buffer_pool: BufferPool,
pub stats: BuildStats,
}
Expand description
Build context that manages optimized strings and buffers
Fields§
§interner: StringInterner
String interner for repeated values
buffer_pool: BufferPool
Buffer pool for XML generation
stats: BuildStats
Statistics
Implementations§
Source§impl BuildContext
impl BuildContext
Sourcepub fn optimize_string(&mut self, s: &str) -> OptimizedString
pub fn optimize_string(&mut self, s: &str) -> OptimizedString
Optimize a string using the context’s interner
Sourcepub fn get_xml_buffer(&mut self, estimated_size: usize) -> String
pub fn get_xml_buffer(&mut self, estimated_size: usize) -> String
Get a buffer for XML generation
Sourcepub fn return_xml_buffer(&mut self, buffer: String)
pub fn return_xml_buffer(&mut self, buffer: String)
Return a buffer to the pool
Sourcepub fn memory_usage(&self) -> MemoryUsage
pub fn memory_usage(&self) -> MemoryUsage
Get memory usage statistics
Sourcepub fn reset_for_next_build(&mut self)
pub fn reset_for_next_build(&mut self)
Reset context for next build (keeps caches)
Sourcepub fn full_reset(&mut self)
pub fn full_reset(&mut self)
Full reset including caches
Trait Implementations§
Source§impl Debug for BuildContext
impl Debug for BuildContext
Source§impl Default for BuildContext
impl Default for BuildContext
Source§fn default() -> BuildContext
fn default() -> BuildContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BuildContext
impl RefUnwindSafe for BuildContext
impl Send for BuildContext
impl Sync for BuildContext
impl Unpin for BuildContext
impl UnwindSafe for BuildContext
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more