pub struct TomlParser<'de> { /* private fields */ }Expand description
Streaming TOML parser backed by toml_parser.
This parser translates TOML’s event stream into the ParseEvent format
expected by facet-format’s deserializer.
Implementations§
Trait Implementations§
Source§impl<'de> FormatParser<'de> for TomlParser<'de>
impl<'de> FormatParser<'de> for TomlParser<'de>
Source§type Probe<'a> = TomlProbe<'de>
where
Self: 'a
type Probe<'a> = TomlProbe<'de> where Self: 'a
Evidence cursor type produced by
FormatParser::begin_probe.Source§fn next_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>
fn next_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>
Read the next parse event, or
None if the input is exhausted. Read moreSource§fn peek_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>
fn peek_event(&mut self) -> Result<Option<ParseEvent<'de>>, Self::Error>
Peek at the next event without consuming it, or
None if at EOF.Source§fn skip_value(&mut self) -> Result<(), Self::Error>
fn skip_value(&mut self) -> Result<(), Self::Error>
Skip the current value (for unknown fields, etc.).
Source§fn begin_probe(&mut self) -> Result<Self::Probe<'_>, Self::Error>
fn begin_probe(&mut self) -> Result<Self::Probe<'_>, Self::Error>
Begin evidence collection for untagged-enum resolution.
Source§fn capture_raw(&mut self) -> Result<Option<&'de str>, Self::Error>
fn capture_raw(&mut self) -> Result<Option<&'de str>, Self::Error>
Capture the raw representation of the current value without parsing it. Read more
Source§fn current_span(&self) -> Option<Span>
fn current_span(&self) -> Option<Span>
Returns the source span of the most recently consumed event. Read more
Source§fn raw_capture_shape(&self) -> Option<&'static Shape>
fn raw_capture_shape(&self) -> Option<&'static Shape>
Returns the shape of the format’s raw capture type (e.g.,
RawJson::SHAPE). Read moreSource§fn is_self_describing(&self) -> bool
fn is_self_describing(&self) -> bool
Returns true if this format is self-describing. Read more
Source§fn hint_struct_fields(&mut self, _num_fields: usize)
fn hint_struct_fields(&mut self, _num_fields: usize)
Hint to the parser that a struct with the given number of fields is expected. Read more
Source§fn hint_scalar_type(&mut self, _hint: ScalarTypeHint)
fn hint_scalar_type(&mut self, _hint: ScalarTypeHint)
Hint to the parser what scalar type is expected next. Read more
Source§fn hint_sequence(&mut self)
fn hint_sequence(&mut self)
Hint to the parser that a sequence (array/Vec) is expected. Read more
Source§fn hint_byte_sequence(&mut self) -> bool
fn hint_byte_sequence(&mut self) -> bool
Source§fn hint_array(&mut self, _len: usize)
fn hint_array(&mut self, _len: usize)
Hint to the parser that a fixed-size array is expected. Read more
Source§fn hint_option(&mut self)
fn hint_option(&mut self)
Hint to the parser that an
Option<T> is expected. Read moreSource§fn hint_dynamic_value(&mut self)
fn hint_dynamic_value(&mut self)
Hint to the parser that a dynamic value is expected. Read more
Source§fn hint_enum(&mut self, _variants: &[EnumVariantHint])
fn hint_enum(&mut self, _variants: &[EnumVariantHint])
Hint to the parser that an enum is expected, providing variant information. Read more
Auto Trait Implementations§
impl<'de> Freeze for TomlParser<'de>
impl<'de> RefUnwindSafe for TomlParser<'de>
impl<'de> Send for TomlParser<'de>
impl<'de> Sync for TomlParser<'de>
impl<'de> Unpin for TomlParser<'de>
impl<'de> UnwindSafe for TomlParser<'de>
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