pub struct FinalizationGuard { /* private fields */ }Expand description
Atomic exactly-once finalization claim shared by actor and shutdown supervisor.
Implementations§
Source§impl FinalizationGuard
impl FinalizationGuard
Sourcepub fn new(
transaction_id: TransactionId,
channel_id: ChannelId,
session_id: Option<SessionId>,
callback: Box<dyn CompletionCallback>,
sequencer: Arc<EventSequencer>,
) -> Arc<Self> ⓘ
pub fn new( transaction_id: TransactionId, channel_id: ChannelId, session_id: Option<SessionId>, callback: Box<dyn CompletionCallback>, sequencer: Arc<EventSequencer>, ) -> Arc<Self> ⓘ
Create a guard holding the one-shot callback.
Sourcepub fn sequencer(&self) -> &Arc<EventSequencer> ⓘ
pub fn sequencer(&self) -> &Arc<EventSequencer> ⓘ
Event sequencer for this transaction.
Sourcepub fn set_session_id(&self, session_id: SessionId)
pub fn set_session_id(&self, session_id: SessionId)
Update session id on the payload before claim (session establishment).
Sourcepub fn try_claim(&self) -> Option<FinalizationPayload>
pub fn try_claim(&self) -> Option<FinalizationPayload>
Claim exactly once. Winner takes payload; losers get None.
Sourcepub fn is_claimed(&self) -> bool
pub fn is_claimed(&self) -> bool
Whether already claimed.
Sourcepub fn mark_callback_scheduled(&self)
pub fn mark_callback_scheduled(&self)
Mark that a callback was scheduled (accounting).
Sourcepub fn callback_was_scheduled(&self) -> bool
pub fn callback_was_scheduled(&self) -> bool
Whether callback was scheduled.
Auto Trait Implementations§
impl !Freeze for FinalizationGuard
impl RefUnwindSafe for FinalizationGuard
impl Send for FinalizationGuard
impl Sync for FinalizationGuard
impl Unpin for FinalizationGuard
impl UnsafeUnpin for FinalizationGuard
impl UnwindSafe for FinalizationGuard
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