pub struct OwnershipStore {
pub item: Item<Ownership<Addr>>,
}Fields§
§item: Item<Ownership<Addr>>Implementations§
Source§impl OwnershipStore
impl OwnershipStore
pub const fn new(key: &'static str) -> Self
Sourcepub fn initialize_owner(
&self,
storage: &mut dyn Storage,
api: &dyn Api,
owner: Option<&str>,
) -> StdResult<Ownership<Addr>>
pub fn initialize_owner( &self, storage: &mut dyn Storage, api: &dyn Api, owner: Option<&str>, ) -> StdResult<Ownership<Addr>>
Set the given address as the contract owner.
This function is only intended to be used only during contract instantiation.
Sourcepub fn is_owner(&self, store: &dyn Storage, addr: &Addr) -> StdResult<bool>
pub fn is_owner(&self, store: &dyn Storage, addr: &Addr) -> StdResult<bool>
Return Ok(true) if the contract has an owner and it’s the given address. Return Ok(false) if the contract doesn’t have an owner, of if it does but it’s not the given address. Return Err if fails to load ownership info from storage.
Sourcepub fn assert_owner(
&self,
store: &dyn Storage,
sender: &Addr,
) -> Result<(), OwnershipError>
pub fn assert_owner( &self, store: &dyn Storage, sender: &Addr, ) -> Result<(), OwnershipError>
Assert that an account is the contract’s current owner.
Sourcepub fn update_ownership(
&self,
deps: DepsMut<'_>,
block: &BlockInfo,
sender: &Addr,
action: Action,
) -> Result<Ownership<Addr>, OwnershipError>
pub fn update_ownership( &self, deps: DepsMut<'_>, block: &BlockInfo, sender: &Addr, action: Action, ) -> Result<Ownership<Addr>, OwnershipError>
Update the contract’s ownership info based on the given action. Return the updated ownership.
Auto Trait Implementations§
impl Freeze for OwnershipStore
impl RefUnwindSafe for OwnershipStore
impl Send for OwnershipStore
impl Sync for OwnershipStore
impl Unpin for OwnershipStore
impl UnwindSafe for OwnershipStore
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more