pub struct Lsn(pub u64);Expand description
PostgreSQL Log Sequence Number.
Represents a position in the write-ahead log (WAL). LSNs are used to track replication progress and identify specific points in the WAL stream.
§Format
PostgreSQL displays LSNs as XXXXXXXX/YYYYYYYY where:
XXXXXXXXis the high 32 bits (segment file number)YYYYYYYYis the low 32 bits (offset within segment)
§Example
use pgwire_replication::lsn::Lsn;
let lsn = Lsn::parse("16/B374D848").unwrap();
assert_eq!(lsn.to_string(), "16/B374D848");
// Or use FromStr
let lsn: Lsn = "16/B374D848".parse().unwrap();Tuple Fields§
§0: u64Implementations§
Trait Implementations§
Source§impl Ord for Lsn
impl Ord for Lsn
Source§impl PartialOrd for Lsn
impl PartialOrd for Lsn
impl Copy for Lsn
impl Eq for Lsn
impl StructuralPartialEq for Lsn
Auto Trait Implementations§
impl Freeze for Lsn
impl RefUnwindSafe for Lsn
impl Send for Lsn
impl Sync for Lsn
impl Unpin for Lsn
impl UnwindSafe for Lsn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more