use crate::value::Value;
#[derive(Clone, Debug, Eq, PartialEq)]
pub(in crate::db::executor) struct GroupedPaginationWindow {
pub(super) limit: Option<usize>,
pub(super) initial_offset_for_page: usize,
pub(super) selection_bound: Option<usize>,
pub(super) resume_initial_offset: u32,
pub(super) resume_boundary: Option<Value>,
}
impl GroupedPaginationWindow {
#[must_use]
pub(in crate::db::executor) const fn new(
limit: Option<usize>,
initial_offset_for_page: usize,
selection_bound: Option<usize>,
resume_initial_offset: u32,
resume_boundary: Option<Value>,
) -> Self {
Self {
limit,
initial_offset_for_page,
selection_bound,
resume_initial_offset,
resume_boundary,
}
}
#[must_use]
pub(in crate::db::executor) const fn limit(&self) -> Option<usize> {
self.limit
}
#[must_use]
pub(in crate::db::executor) const fn initial_offset_for_page(&self) -> usize {
self.initial_offset_for_page
}
#[must_use]
pub(in crate::db::executor) const fn selection_bound(&self) -> Option<usize> {
self.selection_bound
}
#[must_use]
pub(in crate::db::executor) const fn resume_initial_offset(&self) -> u32 {
self.resume_initial_offset
}
#[must_use]
pub(in crate::db::executor) const fn resume_boundary(&self) -> Option<&Value> {
self.resume_boundary.as_ref()
}
}