Struct odra_modules::security::Pauseable
source · pub struct Pauseable { /* private fields */ }Expand description
A module allowing to implement an emergency stop mechanism that can be triggered by any account.
You can use this module in a custom module by adding it as a field.
It will make available require_not_paused() and require_paused() functions,
which can be used in the functions of your contract to ensure the contract is
in the correct state.
Implementations§
source§impl Pauseable
impl Pauseable
sourcepub fn require_not_paused(&self)
pub fn require_not_paused(&self)
Reverts with [Error::UnpausedRequired] if the contract is paused.
sourcepub fn require_paused(&self)
pub fn require_paused(&self)
Reverts with [Error::PausedRequired] if the contract is paused.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Pauseable
impl Send for Pauseable
impl Sync for Pauseable
impl Unpin for Pauseable
impl UnwindSafe for Pauseable
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