Struct json_syntax::parse::Parser

source ·
pub struct Parser<C: Iterator<Item = Result<DecodedChar, E>>, F, E> { /* private fields */ }
Expand description

JSON parser.

Implementations§

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)
	}
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)
	}

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Wraps self inside a Meta<Self, M> using the given metadata. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.