use crate::{
db::{
PersistedRow,
executor::{
ExecutablePlan, pipeline::contracts::LoadExecutor,
terminal::ranking::RankingTerminalBoundaryRequest,
},
response::EntityResponse,
},
error::InternalError,
traits::EntityValue,
};
impl<E> LoadExecutor<E>
where
E: PersistedRow + EntityValue,
{
pub(in crate::db) fn take(
&self,
plan: ExecutablePlan<E>,
take_count: u32,
) -> Result<EntityResponse<E>, InternalError> {
self.execute_ranking_terminal_boundary(
plan.into_prepared_load_plan(),
RankingTerminalBoundaryRequest::Take { take_count },
)?
.into_rows()
}
}