pub struct SyncRow {
pub sequence: u64,
pub action: SyncAction,
}Expand description
One sync log row with monotonic sequence metadata.
Fields§
§sequence: u64Monotonic sequence number assigned by the extension.
action: SyncActionAction to replay.
Implementations§
Source§impl SyncRow
impl SyncRow
Sourcepub fn apply_in_order(
rows: &[Self],
overlay: &mut OverlayState,
) -> Result<usize, PostgresGraphError>
pub fn apply_in_order( rows: &[Self], overlay: &mut OverlayState, ) -> Result<usize, PostgresGraphError>
Applies caller-ordered rows to overlay, rejecting any that are not in
strictly increasing sequence order.
Rows must arrive already sorted by sequence; this method validates that
contract rather than silently normalizing it, so genuinely out-of-order
input (e.g. [5, 3, 1]) is rejected, not just duplicates. The extension
emits rows in sequence order, so this is a cheap defensive check.
§Errors
Returns PostgresGraphError::Sync when a row’s sequence is not strictly
greater than its predecessor.
§Performance
This method is O(r + a) where r is row count and a is applied actions.
Trait Implementations§
impl Copy for SyncRow
impl Eq for SyncRow
impl StructuralPartialEq for SyncRow
Auto Trait Implementations§
impl Freeze for SyncRow
impl RefUnwindSafe for SyncRow
impl Send for SyncRow
impl Sync for SyncRow
impl Unpin for SyncRow
impl UnsafeUnpin for SyncRow
impl UnwindSafe for SyncRow
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