pub struct JsonPointer { /* private fields */ }Expand description
A parsed RFC 6901 JSON pointer (DW-028): the compiled form the
runtime applies and validation checks, so the two can never
disagree on what /items/0 means. Built once at snapshot compile;
the raw config string never reaches the request path (the same
precompute contract as the CORS/compression/deprecation tables).
The grammar is RFC 6901 with the array-index discipline of RFC 6902
(add): a token of digits (no leading zeros, 0 alone allowed)
that fits usize addresses an array element; every other token is
an object key. A container decides which interpretation applies —
on an object the token 0 is the key "0"; on an array the token
a cannot resolve.
Implementations§
Source§impl JsonPointer
impl JsonPointer
Sourcepub fn parse(raw: &str) -> Option<JsonPointer>
pub fn parse(raw: &str) -> Option<JsonPointer>
Parse an RFC 6901 pointer. None = malformed (does not start
with / unless empty, or carries a ~ escape other than ~0
/ ~1).
Sourcepub fn indexes(&self) -> &[Option<usize>]
pub fn indexes(&self) -> &[Option<usize>]
The precomputed array-index form per token, parallel to
tokens (None: the token is not index-shaped
or does not fit usize). Exposed so the analytics body-path
dimension extractor (DW-093) can walk a JSON document without
duplicating the RFC 6901 array-index discipline.
Trait Implementations§
Source§impl Clone for JsonPointer
impl Clone for JsonPointer
Source§fn clone(&self) -> JsonPointer
fn clone(&self) -> JsonPointer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JsonPointer
impl Debug for JsonPointer
Source§impl PartialEq for JsonPointer
impl PartialEq for JsonPointer
impl Eq for JsonPointer
impl StructuralPartialEq for JsonPointer
Auto Trait Implementations§
impl Freeze for JsonPointer
impl RefUnwindSafe for JsonPointer
impl Send for JsonPointer
impl Sync for JsonPointer
impl Unpin for JsonPointer
impl UnwindSafe for JsonPointer
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more