pub enum NamedShapePathKey {
Field(String),
AnyField,
Index(usize),
AnyIndex,
}
Expand description
NamedShapePathKey
represents a single step in a subpath associated with a
ShapeCase::Name
shape reference. When pretty-printed, these subpaths are
delimited by .
characters (with "..."
-quoting as necessary for
non-identifier field names), and can be either ::Field
names or array
::Index
values.
As a special form of catch-all ::Index
value, the step may also be the
wildcard ::AnyIndex
, which denotes a union of all the element shapes of an
array, or just the given shape if not an array, which is useful to support
GraphQL-like array mapping. When pretty-printed, these wildcard keys look
like .*
, and if multiple wildcards are used in a row, they will be
coalesced/simplified down to just one logical .*
.
Variants§
Implementations§
Source§impl NamedShapePathKey
impl NamedShapePathKey
pub fn path_to_string(path: &[NamedShapePathKey]) -> String
Trait Implementations§
Source§impl Clone for NamedShapePathKey
impl Clone for NamedShapePathKey
Source§fn clone(&self) -> NamedShapePathKey
fn clone(&self) -> NamedShapePathKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NamedShapePathKey
impl Debug for NamedShapePathKey
Source§impl From<&str> for NamedShapePathKey
impl From<&str> for NamedShapePathKey
Source§impl From<String> for NamedShapePathKey
impl From<String> for NamedShapePathKey
Source§impl From<usize> for NamedShapePathKey
impl From<usize> for NamedShapePathKey
Source§impl Hash for NamedShapePathKey
impl Hash for NamedShapePathKey
Source§impl PartialEq for NamedShapePathKey
impl PartialEq for NamedShapePathKey
impl Eq for NamedShapePathKey
impl StructuralPartialEq for NamedShapePathKey
Auto Trait Implementations§
impl Freeze for NamedShapePathKey
impl RefUnwindSafe for NamedShapePathKey
impl Send for NamedShapePathKey
impl Sync for NamedShapePathKey
impl Unpin for NamedShapePathKey
impl UnwindSafe for NamedShapePathKey
Blanket Implementations§
Source§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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.