Struct odra_modules::access::Ownable2StepHostRef
source · pub struct Ownable2StepHostRef { /* private fields */ }Expand description
Ownable2Step Host Ref.
Implementations§
source§impl Ownable2StepHostRef
impl Ownable2StepHostRef
sourcepub fn get_pending_owner(&self) -> Option<Address>
pub fn get_pending_owner(&self) -> Option<Address>
Returns the address of the pending owner.
sourcepub fn transfer_ownership(&mut self, new_owner: &Address)
pub fn transfer_ownership(&mut self, new_owner: &Address)
Starts the ownership transfer of the module to a new_owner.
Replaces the pending_ownerif there is one.
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 accept_ownership(&mut self)
pub fn accept_ownership(&mut self)
The new owner accepts the ownership transfer. Replaces the current owner and clears the pending owner.
source§impl Ownable2StepHostRef
impl Ownable2StepHostRef
sourcepub fn try_init(&mut self) -> OdraResult<()>
pub fn try_init(&mut self) -> OdraResult<()>
Initializes the module setting the caller as the initial owner.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_get_owner(&self) -> OdraResult<Address>
pub fn try_get_owner(&self) -> OdraResult<Address>
Returns the address of the current owner.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_get_pending_owner(&self) -> OdraResult<Option<Address>>
pub fn try_get_pending_owner(&self) -> OdraResult<Option<Address>>
Returns the address of the pending owner.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_transfer_ownership(&mut self, new_owner: &Address) -> OdraResult<()>
pub fn try_transfer_ownership(&mut self, new_owner: &Address) -> OdraResult<()>
Starts the ownership transfer of the module to a new_owner.
Replaces the pending_ownerif there is one.
This function can only be accessed by the current owner of the module.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_renounce_ownership(&mut self) -> OdraResult<()>
pub fn try_renounce_ownership(&mut self) -> OdraResult<()>
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.
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_accept_ownership(&mut self) -> OdraResult<()>
pub fn try_accept_ownership(&mut self) -> OdraResult<()>
The new owner accepts the ownership transfer. Replaces the current owner and clears
the pending owner.
Does not fail in case of error, returns odra::OdraResult instead.
Trait Implementations§
source§impl EntryPointsCallerProvider for Ownable2StepHostRef
impl EntryPointsCallerProvider for Ownable2StepHostRef
source§fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
source§impl HasIdent for Ownable2StepHostRef
impl HasIdent for Ownable2StepHostRef
source§impl HostRef for Ownable2StepHostRef
impl HostRef for Ownable2StepHostRef
source§fn new(address: Address, env: HostEnv) -> Self
fn new(address: Address, env: HostEnv) -> Self
source§fn with_tokens(&self, tokens: U512) -> Self
fn with_tokens(&self, tokens: U512) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for Ownable2StepHostRef
impl !Send for Ownable2StepHostRef
impl !Sync for Ownable2StepHostRef
impl Unpin for Ownable2StepHostRef
impl !UnwindSafe for Ownable2StepHostRef
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
§impl<T> Conv for T
impl<T> Conv for T
§impl<R> Deployer for Rwhere
R: HostRef + EntryPointsCallerProvider + HasIdent,
impl<R> Deployer for Rwhere
R: HostRef + EntryPointsCallerProvider + HasIdent,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§impl<T> HostRefLoader for Twhere
T: EntryPointsCallerProvider + HostRef,
impl<T> HostRefLoader for Twhere
T: EntryPointsCallerProvider + HostRef,
§impl<T> Pipe for T
impl<T> Pipe for T
§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
§impl<T> PipeDeref for T
impl<T> PipeDeref for T
§impl<T> PipeRef for T
impl<T> PipeRef for T
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
§fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_dbg<F, R>(self, func: F) -> Self
fn tap_dbg<F, R>(self, func: F) -> Self
tap in debug builds, and does nothing in release builds.§fn tap_mut_dbg<F, R>(self, func: F) -> Self
fn tap_mut_dbg<F, R>(self, func: F) -> Self
tap_mut in debug builds, and does nothing in release builds.§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
tap_ref in debug builds, and does nothing in release builds.§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
§fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self
tap_ref_mut in debug builds, and does nothing in release builds.§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
tap_borrow in debug builds, and does nothing in release builds.§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
§fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self
tap_borrow_mut in debug builds, and does nothing in release
builds.§impl<T> TapDeref for T
impl<T> TapDeref for T
§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
tap_deref in debug builds, and does nothing in release builds.§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
self for modification.§fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self
tap_deref_mut in debug builds, and does nothing in release
builds.