use crate::{base64::Base64Encoded, impl_base64};
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Directory {
inner: Base64Encoded,
}
impl_base64!(Directory);
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct RangeQueryContext<T> {
dir: Option<Directory>,
from: Option<T>,
}
impl<T> Default for RangeQueryContext<T> {
fn default() -> Self { Self { dir: None, from: None } }
}
impl<T> RangeQueryContext<T> {
pub fn new() -> Self { Self::default() }
pub fn set_directory(&mut self, dir: Directory) { self.dir = Some(dir); }
pub fn set_from(&mut self, next_key: T) { self.from = Some(next_key); }
pub fn directory(&self) -> &Option<Directory> { &self.dir }
pub fn from(&self) -> &Option<T> { &self.from }
}