From 2cbb903b06c57e07428c6e3e0bedfb264ae75a3c Mon Sep 17 00:00:00 2001 From: Jussi Saurio Date: Fri, 11 Apr 2025 13:45:10 +0300 Subject: [PATCH] Add doc comments to SeekOp --- core/types.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/types.rs b/core/types.rs index c26e96a41..3d531adfe 100644 --- a/core/types.rs +++ b/core/types.rs @@ -1228,6 +1228,7 @@ pub enum CursorResult { } #[derive(Clone, Copy, PartialEq, Eq, Debug)] +/// The match condition of a table/index seek. pub enum SeekOp { EQ, GE, @@ -1237,6 +1238,15 @@ pub enum SeekOp { } impl SeekOp { + /// A given seek op implies an iteration direction. + /// + /// For example, a seek with SeekOp::GT implies: + /// Find the first table/index key that compares greater than the seek key + /// -> used in forwards iteration. + /// + /// A seek with SeekOp::LE implies: + /// Find the last table/index key that compares less than or equal to the seek key + /// -> used in backwards iteration. pub fn iteration_direction(&self) -> IterationDirection { match self { SeekOp::EQ | SeekOp::GE | SeekOp::GT => IterationDirection::Forwards,