pub struct Parser;Expand description
Parser for YAML documents.
Wraps saphyr’s YAML loading to provide a consistent API.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn parse_all_preserving_styles(input: &str) -> ParseResult<Vec<Value>>
pub fn parse_all_preserving_styles(input: &str) -> ParseResult<Vec<Value>>
Parse all YAML documents preserving scalar styles (literal |, folded >).
Unlike parse_all, this function uses early_parse = false in the loader,
which keeps scalars as Value::Representation nodes with their original style
information instead of resolving them eagerly.
This is used by the format pipeline to preserve block scalar styles in output.
§Errors
Returns ParseError::Scanner if the YAML syntax is invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin for Parser
impl UnwindSafe for Parser
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