Attempts to parse a string into a `Pointer`. If successful, this does not allocate. ## Errors Returns a `ParseError` if the string is not a valid JSON Pointer.
(s: &S)
| 80 | /// ## Errors |
| 81 | /// Returns a `ParseError` if the string is not a valid JSON Pointer. |
| 82 | pub fn parse<S: AsRef<str> + ?Sized>(s: &S) -> Result<&Self, ParseError> { |
| 83 | // SAFETY: we validate first |
| 84 | validate(s.as_ref()).map(|s| unsafe { Self::new_unchecked(s) }) |
| 85 | } |
| 86 | |
| 87 | /// Creates a static `Pointer` from a string. |
| 88 | /// |
nothing calls this directly
no test coverage detected