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

Method source_offset

src/pointer.rs:1298–1303  ·  view source on GitHub ↗

Offset of the character index from within the first token of [`Self::pointer_offset`]) ```text "/foo/invalid~tilde/invalid" ↑ 8 ``` ``` # use jsonptr::PointerBuf; let err = PointerBuf::parse("/foo/invalid~tilde/invalid").unwrap_err(); assert_eq!(err.source_offset(), 8) ```

(&self)

Source from the content-addressed store, hash-verified

1296 /// assert_eq!(err.source_offset(), 8)
1297 /// ```
1298 pub fn source_offset(&self) -> usize {
1299 match self {
1300 Self::NoLeadingSlash { .. } => 0,
1301 Self::InvalidEncoding { source, .. } => source.offset,
1302 }
1303 }
1304
1305 /// Offset of the first invalid encoding from within the pointer.
1306 /// ```text

Callers 1

complete_offsetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected