pub struct QueryEngine<'a> { /* private fields */ }
Expand description
查询条件构建器
Implementations§
Source§impl<'a> QueryEngine<'a>
impl<'a> QueryEngine<'a>
Sourcepub fn new(pool: &'a NodePool) -> QueryEngine<'a>
pub fn new(pool: &'a NodePool) -> QueryEngine<'a>
创建新的查询引擎实例
Sourcepub fn by_type(self, node_type: &'a str) -> QueryEngine<'a>
pub fn by_type(self, node_type: &'a str) -> QueryEngine<'a>
按节点类型查询
Sourcepub fn by_attr(self, key: &'a str, value: &'a Value) -> QueryEngine<'a>
pub fn by_attr(self, key: &'a str, value: &'a Value) -> QueryEngine<'a>
按属性值查询
Sourcepub fn by_mark(self, mark_type: &'a str) -> QueryEngine<'a>
pub fn by_mark(self, mark_type: &'a str) -> QueryEngine<'a>
按标记查询
Sourcepub fn by_child_count(self, count: usize) -> QueryEngine<'a>
pub fn by_child_count(self, count: usize) -> QueryEngine<'a>
按子节点数量查询
Sourcepub fn by_depth(self, depth: usize) -> QueryEngine<'a>
pub fn by_depth(self, depth: usize) -> QueryEngine<'a>
按深度查询
Sourcepub fn by_ancestor_type(self, ancestor_type: &'a str) -> QueryEngine<'a>
pub fn by_ancestor_type(self, ancestor_type: &'a str) -> QueryEngine<'a>
按祖先节点类型查询
Sourcepub fn by_descendant_type(self, descendant_type: &'a str) -> QueryEngine<'a>
pub fn by_descendant_type(self, descendant_type: &'a str) -> QueryEngine<'a>
按后代节点类型查询
Sourcepub fn find_first(&self) -> Option<Arc<Node>>
pub fn find_first(&self) -> Option<Arc<Node>>
执行查询并返回第一个匹配的节点
Sourcepub fn parallel_find_all(&self) -> Vec<Arc<Node>>
pub fn parallel_find_all(&self) -> Vec<Arc<Node>>
并行执行查询并返回所有匹配的节点
Sourcepub fn parallel_find_first(&self) -> Option<Arc<Node>>
pub fn parallel_find_first(&self) -> Option<Arc<Node>>
并行执行查询并返回第一个匹配的节点
Sourcepub fn parallel_count(&self) -> usize
pub fn parallel_count(&self) -> usize
并行执行查询并返回匹配的节点数量
Auto Trait Implementations§
impl<'a> Freeze for QueryEngine<'a>
impl<'a> !RefUnwindSafe for QueryEngine<'a>
impl<'a> Send for QueryEngine<'a>
impl<'a> Sync for QueryEngine<'a>
impl<'a> Unpin for QueryEngine<'a>
impl<'a> !UnwindSafe for QueryEngine<'a>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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