pub enum NestedEagerResult {
Leaf(HashMap<String, Value>),
Node {
row: HashMap<String, Value>,
children: Vec<NestedEagerResult>,
},
}Expand description
多级 Eager Loading 结果(递归类型,v2.2.0 新增)
表示无限级嵌套的 Eager Loading 结果树:
NestedEagerResult::Leaf:叶子节点(无子级关联)NestedEagerResult::Node:分支节点(本级行 + 子级结果)
§用法
ⓘ
use sz_orm_core::eager_loader::NestedEagerResult;
let leaf = NestedEagerResult::Leaf(row);
assert!(leaf.is_leaf());
let node = NestedEagerResult::Node { row, children: vec![] };
assert!(!node.is_leaf());Variants§
Implementations§
Trait Implementations§
Source§impl Clone for NestedEagerResult
impl Clone for NestedEagerResult
Source§fn clone(&self) -> NestedEagerResult
fn clone(&self) -> NestedEagerResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NestedEagerResult
impl RefUnwindSafe for NestedEagerResult
impl Send for NestedEagerResult
impl Sync for NestedEagerResult
impl Unpin for NestedEagerResult
impl UnsafeUnpin for NestedEagerResult
impl UnwindSafe for NestedEagerResult
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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