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)
| 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 |