Struct sp_runtime::offchain::storage_lock::StorageLockGuard
source · pub struct StorageLockGuard<'a, 'b, L: Lockable> { /* private fields */ }
Expand description
RAII style guard for a lock.
Implementations§
source§impl<'a, 'b, L: Lockable> StorageLockGuard<'a, 'b, L>
impl<'a, 'b, L: Lockable> StorageLockGuard<'a, 'b, L>
sourcepub fn forget(self)
pub fn forget(self)
Consume the guard but do not unlock the underlying lock.
Can be used to implement a grace period after doing some heavy computations and sending a transaction to be included on-chain. By forgetting the lock, it will stay locked until its expiration deadline is reached while the off-chain worker can already exit.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b, L> RefUnwindSafe for StorageLockGuard<'a, 'b, L>where
L: RefUnwindSafe,
impl<'a, 'b, L> Send for StorageLockGuard<'a, 'b, L>where
L: Send,
impl<'a, 'b, L> Sync for StorageLockGuard<'a, 'b, L>where
L: Sync,
impl<'a, 'b, L> Unpin for StorageLockGuard<'a, 'b, L>
impl<'a, 'b, L> !UnwindSafe for StorageLockGuard<'a, 'b, L>
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.