use bytes::Bytes;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RocksDbScanItem {
pub key: Bytes,
pub value: Bytes,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RocksDbScanOptions {
pub cf: String,
pub prefix: Vec<u8>,
pub limit: usize,
}
impl RocksDbScanOptions {
pub fn prefix(cf: impl Into<String>, prefix: impl Into<Vec<u8>>, limit: usize) -> Self {
Self {
cf: cf.into(),
prefix: prefix.into(),
limit,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RocksDbRangeScanOptions {
pub cf: String,
pub start: Vec<u8>,
pub end: Vec<u8>,
pub limit: usize,
}
impl RocksDbRangeScanOptions {
pub fn new(cf: impl Into<String>, start: impl Into<Vec<u8>>, end: impl Into<Vec<u8>>, limit: usize) -> Self {
Self {
cf: cf.into(),
start: start.into(),
end: end.into(),
limit,
}
}
}