[−][src]Struct cw_controllers::Admin
Implementations
impl<'a> Admin<'a>
[src]
pub const fn new(namespace: &'a str) -> Self
[src]
pub fn set(&self, deps: DepsMut<'_>, admin: Option<HumanAddr>) -> StdResult<()>
[src]
pub fn get(&self, deps: Deps<'_>) -> StdResult<Option<HumanAddr>>
[src]
pub fn is_admin(&self, deps: Deps<'_>, caller: &HumanAddr) -> StdResult<bool>
[src]
Returns Ok(true) if this is an admin, Ok(false) if not and an Error if we hit an error with Api or Storage usage
pub fn assert_admin(
&self,
deps: Deps<'_>,
caller: &HumanAddr
) -> Result<(), AdminError>
[src]
&self,
deps: Deps<'_>,
caller: &HumanAddr
) -> Result<(), AdminError>
Like is_admin but returns AdminError::NotAdmin if not admin. Helper for a nice one-line auth check.
pub fn handle_update_admin(
&self,
deps: DepsMut<'_>,
info: MessageInfo,
new_admin: Option<HumanAddr>
) -> Result<HandleResponse, AdminError>
[src]
&self,
deps: DepsMut<'_>,
info: MessageInfo,
new_admin: Option<HumanAddr>
) -> Result<HandleResponse, AdminError>
pub fn query_admin(&self, deps: Deps<'_>) -> StdResult<AdminResponse>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Admin<'a>
[src]
impl<'a> Send for Admin<'a>
[src]
impl<'a> Sync for Admin<'a>
[src]
impl<'a> Unpin for Admin<'a>
[src]
impl<'a> UnwindSafe for Admin<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,