Trait vector_lookup::lookup_v2::ValuePath

pub trait ValuePath<'a>: Clone {
    type Iter: Iterator<Item = BorrowedSegment<'a>> + Clone;

    // Required method
    fn segment_iter(&self) -> Self::Iter;

    // Provided methods
    fn concat<T>(&self, path: T) -> PathConcat<Self, T>
       where T: ValuePath<'a> { ... }
    fn eq(&self, other: impl ValuePath<'a>) -> bool { ... }
    fn can_start_with(&self, prefix: impl ValuePath<'a>) -> bool { ... }
    fn to_owned_value_path(&self) -> Result<OwnedValuePath, ()> { ... }
}
Expand description

A path is simply the data describing how to look up a field from a value. This should only be implemented for types that are very cheap to clone, such as references.

Required Associated Types§

type Iter: Iterator<Item = BorrowedSegment<'a>> + Clone

Required Methods§

fn segment_iter(&self) -> Self::Iter

Iterates over the raw “Borrowed” segments.

Provided Methods§

fn concat<T>(&self, path: T) -> PathConcat<Self, T>
where T: ValuePath<'a>,

fn eq(&self, other: impl ValuePath<'a>) -> bool

fn can_start_with(&self, prefix: impl ValuePath<'a>) -> bool

fn to_owned_value_path(&self) -> Result<OwnedValuePath, ()>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl<'a> ValuePath<'a> for &'a str

§

type Iter = JitValuePathIter<'a>

§

fn segment_iter(&self) -> <&'a str as ValuePath<'a>>::Iter

§

impl<'a> ValuePath<'a> for &'a Vec<OwnedSegment>

§

type Iter = OwnedSegmentSliceIter<'a>

§

fn segment_iter(&self) -> <&'a Vec<OwnedSegment> as ValuePath<'a>>::Iter

§

impl<'a> ValuePath<'a> for &'a [OwnedSegment]

§

type Iter = OwnedSegmentSliceIter<'a>

§

fn segment_iter(&self) -> <&'a [OwnedSegment] as ValuePath<'a>>::Iter

§

impl<'a, 'b> ValuePath<'a> for &'b Vec<BorrowedSegment<'a>>

§

type Iter = Cloned<Iter<'b, BorrowedSegment<'a>>>

§

fn segment_iter(&self) -> <&'b Vec<BorrowedSegment<'a>> as ValuePath<'a>>::Iter

Implementors§

§

impl<'a> ValuePath<'a> for &'a OwnedValuePath

§

type Iter = OwnedSegmentSliceIter<'a>

source§

impl<'a> ValuePath<'a> for &'a ConfigValuePath

§

type Iter = <&'a OwnedValuePath as ValuePath<'a>>::Iter

§

impl<'a, 'b> ValuePath<'a> for BorrowedValuePath<'a, 'b>

§

impl<'a, A, B> ValuePath<'a> for PathConcat<A, B>
where A: ValuePath<'a>, B: ValuePath<'a>,

§

type Iter = Chain<<A as ValuePath<'a>>::Iter, <B as ValuePath<'a>>::Iter>