[][src]Struct cw_controllers::Admin

pub struct Admin<'a>(_);

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.