pub struct ReducedAllocComposer {
parser: BasicParser,
position: Position,
anchors: HashMap<String, Rc<OptimizedValue>>,
limits: Limits,
resource_tracker: ResourceTracker,
alias_expansion_stack: Vec<String>,
current_depth: usize,
}Expand description
An optimized composer that reduces allocations
Fields§
§parser: BasicParser§position: Position§anchors: HashMap<String, Rc<OptimizedValue>>Store anchors using Rc for cheap cloning
limits: Limits§resource_tracker: ResourceTracker§alias_expansion_stack: Vec<String>§current_depth: usizeImplementations§
Source§impl ReducedAllocComposer
impl ReducedAllocComposer
Sourcepub fn with_limits(input: String, limits: Limits) -> Self
pub fn with_limits(input: String, limits: Limits) -> Self
Create a new optimized composer with custom limits
Sourcefn compose_node(&mut self) -> Result<Option<OptimizedValue>>
fn compose_node(&mut self) -> Result<Option<OptimizedValue>>
Compose a node from events with reduced allocations
Sourcefn compose_scalar_optimized(
&self,
value: String,
style: ScalarStyle,
) -> Result<OptimizedValue>
fn compose_scalar_optimized( &self, value: String, style: ScalarStyle, ) -> Result<OptimizedValue>
Compose a scalar value with optimization
Sourcefn compose_sequence(&mut self) -> Result<Option<OptimizedValue>>
fn compose_sequence(&mut self) -> Result<Option<OptimizedValue>>
Compose a sequence with reduced allocations
Sourcefn compose_mapping(&mut self) -> Result<Option<OptimizedValue>>
fn compose_mapping(&mut self) -> Result<Option<OptimizedValue>>
Compose a mapping with reduced allocations
Sourcefn process_merge_key(
&self,
mapping: &mut IndexMap<OptimizedValue, OptimizedValue>,
merge_value: &OptimizedValue,
) -> Result<()>
fn process_merge_key( &self, mapping: &mut IndexMap<OptimizedValue, OptimizedValue>, merge_value: &OptimizedValue, ) -> Result<()>
Process a merge key by merging values into the current mapping
Trait Implementations§
Source§impl OptimizedComposer for ReducedAllocComposer
impl OptimizedComposer for ReducedAllocComposer
Source§fn check_document(&self) -> bool
fn check_document(&self) -> bool
Check if there are more documents available
Source§fn compose_document(&mut self) -> Result<Option<OptimizedValue>>
fn compose_document(&mut self) -> Result<Option<OptimizedValue>>
Compose the next document with minimal allocations
Auto Trait Implementations§
impl Freeze for ReducedAllocComposer
impl !RefUnwindSafe for ReducedAllocComposer
impl !Send for ReducedAllocComposer
impl !Sync for ReducedAllocComposer
impl Unpin for ReducedAllocComposer
impl !UnwindSafe for ReducedAllocComposer
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