icydb-core 0.98.1

IcyDB — A schema-first typed query engine and persistence runtime for Internet Computer canisters
Documentation
//! Module: db::executor::terminal::ranking::take
//! Defines bounded take helpers used by terminal ranking paths.
//! Does not own: cross-module orchestration outside this module.
//! Boundary: exposes this module API while keeping implementation details internal.

use crate::{
    db::{
        PersistedRow,
        executor::{PreparedExecutionPlan, pipeline::contracts::LoadExecutor},
        response::EntityResponse,
    },
    error::InternalError,
    traits::EntityValue,
};

impl<E> LoadExecutor<E>
where
    E: PersistedRow + EntityValue,
{
    /// Execute one `take(k)` terminal over the canonical load response.
    pub(in crate::db) fn take(
        &self,
        plan: PreparedExecutionPlan<E>,
        take_count: u32,
    ) -> Result<EntityResponse<E>, InternalError> {
        self.execute_take_terminal_boundary(plan.into_prepared_load_plan(), take_count)
    }
}