pub struct BasicComposer {
parser: BasicParser,
position: Position,
anchors: HashMap<String, Value>,
limits: Limits,
resource_tracker: ResourceTracker,
alias_expansion_stack: Vec<String>,
current_depth: usize,
tag_resolver: TagResolver,
yaml_version: YamlVersion,
}Expand description
A basic composer implementation for converting events to nodes
Fields§
§parser: BasicParser§position: Position§anchors: HashMap<String, Value>§limits: Limits§resource_tracker: ResourceTracker§alias_expansion_stack: Vec<String>§current_depth: usize§tag_resolver: TagResolver§yaml_version: YamlVersionActive YAML spec version for the current document, set from the
%YAML directive (when present) on each DocumentStart event.
Defaults to YamlVersion::V1_2.
Implementations§
Source§impl BasicComposer
impl BasicComposer
Sourcepub fn with_limits(input: String, limits: Limits) -> Self
pub fn with_limits(input: String, limits: Limits) -> Self
Create a new composer with custom limits
Sourcepub fn new_eager(input: String) -> Self
pub fn new_eager(input: String) -> Self
Create a new composer with eager parsing (for compatibility)
Sourcepub fn new_eager_with_limits(input: String, limits: Limits) -> Self
pub fn new_eager_with_limits(input: String, limits: Limits) -> Self
Create a new composer with eager parsing and custom limits
Sourcefn compose_node(&mut self) -> Result<Option<Value>>
fn compose_node(&mut self) -> Result<Option<Value>>
Compose a node from events (recursive)
Sourcefn compose_scalar(
&self,
value: String,
style: ScalarStyle,
position: Position,
) -> Result<Value>
fn compose_scalar( &self, value: String, style: ScalarStyle, position: Position, ) -> Result<Value>
Compose a scalar value.
Single- and double-quoted scalars always become Value::String.
Plain, literal, and folded scalars go through the shared
resolve_plain_scalar helper so the YAML version (1.1 vs 1.2)
governs which boolean forms are recognized.
position is the scalar’s source position, used only to anchor
the error returned for the YAML 1.1 !!value (=) tag.
Sourcefn compose_tagged_scalar(
&mut self,
value: String,
tag_str: String,
) -> Result<Value>
fn compose_tagged_scalar( &mut self, value: String, tag_str: String, ) -> Result<Value>
Compose a tagged scalar value
Sourcefn compose_sequence(&mut self) -> Result<Option<Value>>
fn compose_sequence(&mut self) -> Result<Option<Value>>
Compose a sequence
Sourcefn compose_mapping(&mut self) -> Result<Option<Value>>
fn compose_mapping(&mut self) -> Result<Option<Value>>
Compose a mapping