pub struct FormatDeserializer<'input, const BORROW: bool, P> { /* private fields */ }Expand description
Generic deserializer that drives a format-specific parser directly into Partial.
The const generic BORROW controls whether string data can be borrowed:
BORROW=true: strings without escapes are borrowed from inputBORROW=false: all strings are owned
Implementations§
Source§impl<'input, P> FormatDeserializer<'input, true, P>
impl<'input, P> FormatDeserializer<'input, true, P>
Source§impl<'input, P> FormatDeserializer<'input, false, P>
impl<'input, P> FormatDeserializer<'input, false, P>
Source§impl<'input, const BORROW: bool, P> FormatDeserializer<'input, BORROW, P>
impl<'input, const BORROW: bool, P> FormatDeserializer<'input, BORROW, P>
Sourcepub fn into_inner(self) -> P
pub fn into_inner(self) -> P
Consume the facade and return the underlying parser.
Sourcepub fn parser_mut(&mut self) -> &mut P
pub fn parser_mut(&mut self) -> &mut P
Borrow the inner parser mutably.
Source§impl<'input, P> FormatDeserializer<'input, true, P>where
P: FormatParser<'input>,
impl<'input, P> FormatDeserializer<'input, true, P>where
P: FormatParser<'input>,
Sourcepub fn deserialize<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
pub fn deserialize<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
Deserialize the next value in the stream into T, allowing borrowed strings.
Sourcepub fn deserialize_root<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
pub fn deserialize_root<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
Deserialize the next value in the stream into T (for backward compatibility).
Sourcepub fn deserialize_deferred<T>(
&mut self,
) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
pub fn deserialize_deferred<T>(
&mut self,
) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'input>,
Deserialize using deferred mode, allowing interleaved field initialization.
This is required for formats like TOML that allow table reopening, where fields of a nested struct may be set, then fields of a sibling, then more fields of the original struct.
Source§impl<'input, P> FormatDeserializer<'input, false, P>where
P: FormatParser<'input>,
impl<'input, P> FormatDeserializer<'input, false, P>where
P: FormatParser<'input>,
Sourcepub fn deserialize<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
pub fn deserialize<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
Deserialize the next value in the stream into T, using owned strings.
Sourcepub fn deserialize_root<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
pub fn deserialize_root<T>(&mut self) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
Deserialize the next value in the stream into T (for backward compatibility).
Sourcepub fn deserialize_deferred<T>(
&mut self,
) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
pub fn deserialize_deferred<T>(
&mut self,
) -> Result<T, DeserializeError<P::Error>>where
T: Facet<'static>,
Deserialize using deferred mode, allowing interleaved field initialization.
This is required for formats like TOML that allow table reopening, where fields of a nested struct may be set, then fields of a sibling, then more fields of the original struct.
Source§impl<'input, const BORROW: bool, P> FormatDeserializer<'input, BORROW, P>where
P: FormatParser<'input>,
impl<'input, const BORROW: bool, P> FormatDeserializer<'input, BORROW, P>where
P: FormatParser<'input>,
Sourcepub fn deserialize_into(
&mut self,
wip: Partial<'input, BORROW>,
) -> Result<Partial<'input, BORROW>, DeserializeError<P::Error>>
pub fn deserialize_into( &mut self, wip: Partial<'input, BORROW>, ) -> Result<Partial<'input, BORROW>, DeserializeError<P::Error>>
Main deserialization entry point - deserialize into a Partial.