MCPcopy Create free account
hub / github.com/chanced/jsonptr / labels

Method labels

src/pointer.rs:1215–1224  ·  view source on GitHub ↗
(&self, subject: &Self::Subject)

Source from the content-addressed store, hash-verified

1213 }
1214
1215 fn labels(&self, subject: &Self::Subject) -> Option<Box<dyn Iterator<Item = Label>>> {
1216 let offset = self.complete_offset();
1217 let len = self.invalid_encoding_len(subject);
1218 let text = match self {
1219 ParseError::NoLeadingSlash => "must start with a slash ('/')",
1220 ParseError::InvalidEncoding { .. } => "'~' must be followed by '0' or '1'",
1221 }
1222 .to_string();
1223 Some(Box::new(once(Label::new(text, offset, len))))
1224 }
1225}
1226
1227#[cfg(feature = "miette")]

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
complete_offsetMethod · 0.80
invalid_encoding_lenMethod · 0.80

Tested by

no test coverage detected