pub struct CutoverContext { /* private fields */ }Expand description
What a participant hook is told about the cutover it is part of.
Implementations§
Source§impl CutoverContext
impl CutoverContext
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The cutover id (random, fresh for each attempt, persisted in the record).
Sourcepub fn generation(&self) -> u64
pub fn generation(&self) -> u64
The generation number: 1 for the first attempt at this new root, one more for each rerun after an abort or an interruption. A service can fence stale replies with it.
Sourcepub fn old_root(&self) -> &Path
pub fn old_root(&self) -> &Path
The canonical old root. Participants must treat it as read-only.
Sourcepub fn resumed(&self) -> bool
pub fn resumed(&self) -> bool
True when this attempt follows an earlier one that did not complete, or finishes a switched cutover after a restart. Hooks must be idempotent: work an earlier attempt already finished is verified, not redone or refused.
The root a participant must be using after settlement.
Trait Implementations§
Source§impl Clone for CutoverContext
impl Clone for CutoverContext
Auto Trait Implementations§
impl Freeze for CutoverContext
impl RefUnwindSafe for CutoverContext
impl Send for CutoverContext
impl Sync for CutoverContext
impl Unpin for CutoverContext
impl UnsafeUnpin for CutoverContext
impl UnwindSafe for CutoverContext
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