pub trait Format {
// Required methods
fn source(&self) -> &'static str;
fn next<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
expectation: Expectation,
) -> NextResult<'input, 'facet, 'shape, Spanned<Outcome<'input>>, Spanned<DeserErrorKind<'shape>>>
where 'shape: 'input;
fn skip<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
) -> NextResult<'input, 'facet, 'shape, Span, Spanned<DeserErrorKind<'shape>>>
where 'shape: 'input;
}Expand description
Trait defining a deserialization format. Provides the next parsing step based on current state and expected input.
Required Methods§
Sourcefn source(&self) -> &'static str
fn source(&self) -> &'static str
The lowercase source ID of the format, used for error reporting.
Sourcefn next<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
expectation: Expectation,
) -> NextResult<'input, 'facet, 'shape, Spanned<Outcome<'input>>, Spanned<DeserErrorKind<'shape>>>where
'shape: 'input,
fn next<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
expectation: Expectation,
) -> NextResult<'input, 'facet, 'shape, Spanned<Outcome<'input>>, Spanned<DeserErrorKind<'shape>>>where
'shape: 'input,
Advance the parser with current state and expectation, producing the next outcome or error.
Sourcefn skip<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
) -> NextResult<'input, 'facet, 'shape, Span, Spanned<DeserErrorKind<'shape>>>where
'shape: 'input,
fn skip<'input, 'facet, 'shape>(
&mut self,
nd: NextData<'input, 'facet, 'shape>,
) -> NextResult<'input, 'facet, 'shape, Span, Spanned<DeserErrorKind<'shape>>>where
'shape: 'input,
Skip the next value; used to ignore an input.