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

Method pointer_offset

src/pointer.rs:1278–1283  ·  view source on GitHub ↗

Offset of the partial pointer starting with the token which caused the error. ```text "/foo/invalid~tilde/invalid" ↑ ``` ``` # use jsonptr::PointerBuf; let err = PointerBuf::parse("/foo/invalid~tilde/invalid").unwrap_err(); assert_eq!(err.pointer_offset(), 4) ```

(&self)

Source from the content-addressed store, hash-verified

1276 /// assert_eq!(err.pointer_offset(), 4)
1277 /// ```
1278 pub fn pointer_offset(&self) -> usize {
1279 match *self {
1280 Self::NoLeadingSlash { .. } => 0,
1281 Self::InvalidEncoding { offset, .. } => offset,
1282 }
1283 }
1284
1285 /// Offset of the character index from within the first token of
1286 /// [`Self::pointer_offset`])

Callers 1

complete_offsetMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected