Struct json_syntax::parse::Parser
source · pub struct Parser<C: Iterator<Item = Result<DecodedChar, E>>, F, E> { /* private fields */ }
Expand description
JSON parser.
Implementations§
source§impl<C: Iterator<Item = Result<DecodedChar, E>>, F, M, E> Parser<C, F, E>where
F: FnMut(Span) -> M,
impl<C: Iterator<Item = Result<DecodedChar, E>>, F, M, E> Parser<C, F, E>where
F: FnMut(Span) -> M,
sourcepub fn new(chars: C, metadata_builder: F) -> Self
pub fn new(chars: C, metadata_builder: F) -> Self
Examples found in repository?
src/parse.rs (line 140)
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
fn parse_infallible<C, F>(
chars: C,
metadata_builder: F,
) -> Result<Meta<Self, M>, Meta<Error<M>, M>>
where
C: Iterator<Item = DecodedChar>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new(chars.map(Ok), metadata_builder);
Self::parse_in(&mut parser, Context::None)
}
fn parse_infallible_with<C, F>(
chars: C,
options: Options,
metadata_builder: F,
) -> Result<Meta<Self, M>, Meta<Error<M>, M>>
where
C: Iterator<Item = DecodedChar>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new_with(chars.map(Ok), options, metadata_builder);
Self::parse_in(&mut parser, Context::None)
}
fn parse<C, F, E>(chars: C, metadata_builder: F) -> Result<Meta<Self, M>, Meta<Error<M, E>, M>>
where
C: Iterator<Item = Result<DecodedChar, E>>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new(chars, metadata_builder);
Self::parse_in(&mut parser, Context::None)
}
sourcepub fn new_with(chars: C, options: Options, metadata_builder: F) -> Self
pub fn new_with(chars: C, options: Options, metadata_builder: F) -> Self
Examples found in repository?
src/parse.rs (line 153)
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
fn parse_infallible_with<C, F>(
chars: C,
options: Options,
metadata_builder: F,
) -> Result<Meta<Self, M>, Meta<Error<M>, M>>
where
C: Iterator<Item = DecodedChar>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new_with(chars.map(Ok), options, metadata_builder);
Self::parse_in(&mut parser, Context::None)
}
fn parse<C, F, E>(chars: C, metadata_builder: F) -> Result<Meta<Self, M>, Meta<Error<M, E>, M>>
where
C: Iterator<Item = Result<DecodedChar, E>>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new(chars, metadata_builder);
Self::parse_in(&mut parser, Context::None)
}
fn parse_with<C, F, E>(
chars: C,
options: Options,
metadata_builder: F,
) -> Result<Meta<Self, M>, Meta<Error<M, E>, M>>
where
C: Iterator<Item = Result<DecodedChar, E>>,
F: FnMut(Span) -> M,
{
let mut parser = Parser::new_with(chars, options, metadata_builder);
Self::parse_in(&mut parser, Context::None)
}