pub struct Nested<E = Root, C = Value> { /* private fields */ }Expand description
A nested array of objects. E is the enclosing scope (where queries
over this array land — Root at the top level, the parent element type when
deeper); C is the child scope (the element type). Lifting a child query
(Query<C>) through any/all produces a Query<E>.
Implementations§
Source§impl<E, C> Nested<E, C>
impl<E, C> Nested<E, C>
pub fn at(path: impl Into<String>) -> Self
Sourcepub fn any(&self, query: impl AsQuery<C>) -> Query<E>
pub fn any(&self, query: impl AsQuery<C>) -> Query<E>
Parents with at least one element matching query.
Sourcepub fn all(&self, query: impl AsQuery<C>) -> Query<E>
pub fn all(&self, query: impl AsQuery<C>) -> Query<E>
Parents where every element matches query (“no element fails it”).
Sourcepub fn matching(&self, query: impl AsQuery<C>) -> NestedProjection
pub fn matching(&self, query: impl AsQuery<C>) -> NestedProjection
Shape the returned array: keep elements matching query (with the
builder’s sort/size). Pass to crate::Search::filter_nested.
Sourcepub fn project(&self) -> NestedProjection
pub fn project(&self) -> NestedProjection
Like matching with no predicate — every element.
Trait Implementations§
Auto Trait Implementations§
impl<E, C> Freeze for Nested<E, C>
impl<E, C> RefUnwindSafe for Nested<E, C>
impl<E, C> Send for Nested<E, C>
impl<E, C> Sync for Nested<E, C>
impl<E, C> Unpin for Nested<E, C>
impl<E, C> UnsafeUnpin for Nested<E, C>
impl<E, C> UnwindSafe for Nested<E, C>
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