MCPcopy Create free account
hub / github.com/biblius/validify / parse

Method parse

validify_derive/src/lib.rs:271–292  ·  view source on GitHub ↗
(input: syn::parse::ParseStream)

Source from the content-addressed store, hash-verified

269
270impl Parse for SchemaErr {
271 fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
272 let code = input.parse()?;
273
274 if input.peek(Token![,]) {
275 input.parse::<Token![,]>()?;
276 }
277
278 if input.is_empty() {
279 return Ok(SchemaErr {
280 code,
281 message: None,
282 });
283 }
284
285 let message = input.parse()?;
286
287 if input.peek(Token![,]) {
288 input.parse::<Token![,]>()?;
289 }
290
291 Ok(SchemaErr { code, message })
292 }
293}
294
295/// Designed to be used with the [schema_validation] macro. Used for ergonomic custom error handling.

Callers 2

collect_modifiersFunction · 0.80
to_validify_tokensMethod · 0.80

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected