mirror of
https://github.com/neondatabase/neon.git
synced 2026-05-24 00:20:37 +00:00
implement Debug for Lsn type
This commit is contained in:
@@ -10,7 +10,7 @@ use std::sync::atomic::{AtomicU64, Ordering};
|
||||
pub const XLOG_BLCKSZ: u32 = 8192;
|
||||
|
||||
/// A Postgres LSN (Log Sequence Number), also known as an XLogRecPtr
|
||||
#[derive(Debug, Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
|
||||
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
|
||||
pub struct Lsn(pub u64);
|
||||
|
||||
/// We tried to parse an LSN from a string, but failed
|
||||
@@ -122,6 +122,12 @@ impl fmt::Display for Lsn {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Lsn {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:X}/{:X}", self.0 >> 32, self.0 & 0xffffffff)
|
||||
}
|
||||
}
|
||||
|
||||
impl Add<u64> for Lsn {
|
||||
type Output = Lsn;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user