From bae377ed816e0d4fc75c1d188d806732627b8ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Wed, 25 Oct 2023 21:01:19 +0200 Subject: [PATCH] Add rustdoc comments to enum This adds rustdoc comments as per https://github.com/neondatabase/neon/pull/3689#discussion_r1115650916 (with some modifications/improvements) --- pageserver/src/pgdatadir_mapping.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pageserver/src/pgdatadir_mapping.rs b/pageserver/src/pgdatadir_mapping.rs index 9ce059de1f..ae3e3aca8d 100644 --- a/pageserver/src/pgdatadir_mapping.rs +++ b/pageserver/src/pgdatadir_mapping.rs @@ -30,9 +30,21 @@ pub type BlockNumber = u32; #[derive(Debug)] pub enum LsnForTimestamp { + /// Found commits both before and after the given timestamp Present(Lsn), + + /// All commits <= LSN happened before the given timestamp Future(Lsn), + + /// All commits > LSN happened after the given timestamp, + /// but any commits older than the returned LSN + /// might have happened before or after the given timestamp. + /// We don't know because no data before the given lsn is available Past(Lsn), + + /// We have found no commit with a timestamp, + /// so we can't return anything meaningful. + /// The associated LSN is a lower bound value. NoData(Lsn), }