pub struct ZeroCopyComposer<'a> {
parser: BasicParser,
position: Position,
anchors: HashMap<&'a str, BorrowedValue<'a>>,
limits: Limits,
resource_tracker: ResourceTracker,
alias_expansion_stack: Vec<&'a str>,
current_depth: usize,
input: &'a str,
}Expand description
A zero-copy composer implementation
Fields§
§parser: BasicParser§position: Position§anchors: HashMap<&'a str, BorrowedValue<'a>>Store anchors as borrowed values when possible
limits: Limits§resource_tracker: ResourceTracker§alias_expansion_stack: Vec<&'a str>§current_depth: usize§input: &'a strReference to the input string for borrowing
Implementations§
Source§impl<'a> ZeroCopyComposer<'a>
impl<'a> ZeroCopyComposer<'a>
Sourcepub fn with_limits(input: &'a str, limits: Limits) -> Self
pub fn with_limits(input: &'a str, limits: Limits) -> Self
Create a new zero-copy composer with custom limits
Sourcefn compose_node(&mut self) -> Result<Option<BorrowedValue<'a>>>
fn compose_node(&mut self) -> Result<Option<BorrowedValue<'a>>>
Compose a node from events with minimal allocations
Sourcefn compose_scalar_borrowed(
&self,
value: &str,
style: ScalarStyle,
) -> Result<BorrowedValue<'a>>
fn compose_scalar_borrowed( &self, value: &str, style: ScalarStyle, ) -> Result<BorrowedValue<'a>>
Compose a scalar value with borrowing when possible
Sourcefn compose_sequence(&mut self) -> Result<Option<BorrowedValue<'a>>>
fn compose_sequence(&mut self) -> Result<Option<BorrowedValue<'a>>>
Compose a sequence with minimal allocations
Sourcefn compose_mapping(&mut self) -> Result<Option<BorrowedValue<'a>>>
fn compose_mapping(&mut self) -> Result<Option<BorrowedValue<'a>>>
Compose a mapping with minimal allocations
Trait Implementations§
Source§impl<'a> BorrowedComposer<'a> for ZeroCopyComposer<'a>
impl<'a> BorrowedComposer<'a> for ZeroCopyComposer<'a>
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<BorrowedValue<'a>>>
fn compose_document(&mut self) -> Result<Option<BorrowedValue<'a>>>
Compose the next document with minimal allocations
Auto Trait Implementations§
impl<'a> Freeze for ZeroCopyComposer<'a>
impl<'a> !RefUnwindSafe for ZeroCopyComposer<'a>
impl<'a> Send for ZeroCopyComposer<'a>
impl<'a> Sync for ZeroCopyComposer<'a>
impl<'a> Unpin for ZeroCopyComposer<'a>
impl<'a> !UnwindSafe for ZeroCopyComposer<'a>
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