Struct odra_modules::access::OwnableContractRef
source · pub struct OwnableContractRef { /* private fields */ }Expand description
Ownable Contract Ref.
Implementations§
source§impl OwnableContractRef
impl OwnableContractRef
sourcepub fn transfer_ownership(&mut self, new_owner: &Address)
pub fn transfer_ownership(&mut self, new_owner: &Address)
Transfers ownership of the module to new_owner. This function can only
be accessed by the current owner of the module.
sourcepub fn renounce_ownership(&mut self)
pub fn renounce_ownership(&mut self)
If the contract’s owner chooses to renounce their ownership, the contract will no longer have an owner. This means that any functions that can only be accessed by the owner will no longer be available.
The function can only be called by the current owner, and it will permanently remove the owner’s privileges.
sourcepub fn assert_owner(&self, address: &Address)
pub fn assert_owner(&self, address: &Address)
Reverts with Error::CallerNotTheOwner if the function called by
any account other than the owner.
sourcepub fn get_optional_owner(&self) -> Option<Address>
pub fn get_optional_owner(&self) -> Option<Address>
Returns the optional address of the current owner.
sourcepub fn unchecked_transfer_ownership(&mut self, new_owner: Option<Address>)
pub fn unchecked_transfer_ownership(&mut self, new_owner: Option<Address>)
Unchecked version of the ownership transfer. It emits an event and sets the new owner.
Trait Implementations§
source§impl ContractRef for OwnableContractRef
impl ContractRef for OwnableContractRef
source§impl SchemaErrors for OwnableContractRef
impl SchemaErrors for OwnableContractRef
source§impl SchemaEvents for OwnableContractRef
impl SchemaEvents for OwnableContractRef
source§fn custom_types() -> Vec<Option<CustomType>>
fn custom_types() -> Vec<Option<CustomType>>
Returns a vector of CustomTypes. Read more
Auto Trait Implementations§
impl Freeze for OwnableContractRef
impl !RefUnwindSafe for OwnableContractRef
impl !Send for OwnableContractRef
impl !Sync for OwnableContractRef
impl Unpin for OwnableContractRef
impl !UnwindSafe for OwnableContractRef
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