MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / struct_variant

Method struct_variant

src/serde.rs:408–427  ·  view source on GitHub ↗
(
    self,
    _fields: &'static [&'static str],
    visitor: V,
  )

Source from the content-addressed store, hash-verified

406 }
407
408 fn struct_variant<V: Visitor<'de>>(
409 self,
410 _fields: &'static [&'static str],
411 visitor: V,
412 ) -> Result<V::Value, Self::Error> {
413 match self.parser.scan()? {
414 Some(Token::OpenBrace) => {
415 self.parser.enter_container()?;
416 let result = visitor.visit_map(ScannerMapAccess {
417 parser: self.parser,
418 first: true,
419 });
420 self.parser.exit_container();
421 result
422 }
423 _ => Err(ParseError::custom_err(
424 "expected an object for struct variant".to_string(),
425 )),
426 }
427 }
428}
429
430#[cfg(test)]

Callers

nothing calls this directly

Calls 3

enter_containerMethod · 0.80
exit_containerMethod · 0.80
scanMethod · 0.45

Tested by

no test coverage detected