pub struct LogPosition {
pub sequence: u32,
pub offset: u32,
}Expand description
A position in the log: sector sequence plus byte offset within that sector.
Sequence numbers are monotonic for the lifetime of a database, so ordering
LogPosition lexicographically — which is what the derived Ord does — is
exactly log order. This is the coordinate system used to resume a replication
stream across reboots and across removals of the destination medium.
A position is not portable between databases: sequence numbers are allocated per database, so a position from one log means nothing in another.
Fields§
§sequence: u32Sequence number of the sector this position falls in.
offset: u32Byte offset within that sector.
Implementations§
Source§impl LogPosition
impl LogPosition
Trait Implementations§
Source§impl Clone for LogPosition
impl Clone for LogPosition
impl Copy for LogPosition
Source§impl Debug for LogPosition
impl Debug for LogPosition
Source§impl Default for LogPosition
impl Default for LogPosition
impl Eq for LogPosition
Source§impl Format for LogPosition
Available on crate feature defmt only.
impl Format for LogPosition
Available on crate feature
defmt only.Source§impl Hash for LogPosition
impl Hash for LogPosition
Source§impl Ord for LogPosition
impl Ord for LogPosition
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for LogPosition
impl PartialEq for LogPosition
Source§impl PartialOrd for LogPosition
impl PartialOrd for LogPosition
impl StructuralPartialEq for LogPosition
Auto Trait Implementations§
impl Freeze for LogPosition
impl RefUnwindSafe for LogPosition
impl Send for LogPosition
impl Sync for LogPosition
impl Unpin for LogPosition
impl UnsafeUnpin for LogPosition
impl UnwindSafe for LogPosition
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