pub struct LoadExecutor<E: EntityKind> { /* private fields */ }Expand description
LoadExecutor
Implementations§
Source§impl<E: EntityKind> LoadExecutor<E>
impl<E: EntityKind> LoadExecutor<E>
pub const fn new(db: Db<E::Canister>, debug: bool) -> Self
Sourcepub fn execute(
&self,
plan: ExecutablePlan<E>,
) -> Result<Response<E>, InternalError>
pub fn execute( &self, plan: ExecutablePlan<E>, ) -> Result<Response<E>, InternalError>
Execute an executor-ready plan directly (no planner inference).
Sourcepub fn require_one(&self, plan: ExecutablePlan<E>) -> Result<(), InternalError>
pub fn require_one(&self, plan: ExecutablePlan<E>) -> Result<(), InternalError>
Execute a plan and require exactly one row.
Sourcepub fn count(&self, plan: ExecutablePlan<E>) -> Result<u32, InternalError>
pub fn count(&self, plan: ExecutablePlan<E>) -> Result<u32, InternalError>
Count rows matching a plan.
Sourcepub fn group_count_by<K, F>(
&self,
plan: ExecutablePlan<E>,
key_fn: F,
) -> Result<HashMap<K, u32>, InternalError>
pub fn group_count_by<K, F>( &self, plan: ExecutablePlan<E>, key_fn: F, ) -> Result<HashMap<K, u32>, InternalError>
Group rows matching a plan and count them by a derived key.
This is intentionally implemented on the executor (not Response) so it can later avoid full deserialization.
Trait Implementations§
Source§impl<E: Clone + EntityKind> Clone for LoadExecutor<E>
impl<E: Clone + EntityKind> Clone for LoadExecutor<E>
Source§fn clone(&self) -> LoadExecutor<E>
fn clone(&self) -> LoadExecutor<E>
Returns a duplicate 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 moreAuto Trait Implementations§
impl<E> Freeze for LoadExecutor<E>
impl<E> !RefUnwindSafe for LoadExecutor<E>
impl<E> Send for LoadExecutor<E>
impl<E> Sync for LoadExecutor<E>
impl<E> Unpin for LoadExecutor<E>
impl<E> !UnwindSafe for LoadExecutor<E>
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