FeatureToggle

Struct FeatureToggle 

Source
pub struct FeatureToggle;

Trait Implementations§

Source§

impl FeatureToggleTrait for FeatureToggle

Source§

const STORAGE_KEY: &'static [u8] = b"feature_toggle"

Source§

fn init_features<T: Serialize>( storage: &mut dyn Storage, feature_statuses: Vec<FeatureStatus<T>>, pausers: Vec<Addr>, ) -> StdResult<()>

Source§

fn require_not_paused<T: Serialize>( storage: &dyn Storage, features: Vec<T>, ) -> StdResult<()>

Source§

fn pause<T: Serialize>( storage: &mut dyn Storage, features: Vec<T>, ) -> StdResult<()>

Source§

fn unpause<T: Serialize>( storage: &mut dyn Storage, features: Vec<T>, ) -> StdResult<()>

Source§

fn is_pauser(storage: &dyn Storage, key: &Addr) -> StdResult<bool>

Source§

fn set_pauser(storage: &mut dyn Storage, key: &Addr) -> StdResult<()>

Source§

fn remove_pauser(storage: &mut dyn Storage, key: &Addr)

Source§

fn get_feature_status<T: Serialize>( storage: &dyn Storage, key: &T, ) -> StdResult<Option<Status>>

Source§

fn set_feature_status<T: Serialize>( storage: &mut dyn Storage, key: &T, item: Status, ) -> StdResult<()>

Source§

fn handle_pause<T: Serialize>( deps: DepsMut<'_>, info: &MessageInfo, features: Vec<T>, ) -> StdResult<Response>

Source§

fn handle_unpause<T: Serialize>( deps: DepsMut<'_>, info: &MessageInfo, features: Vec<T>, ) -> StdResult<Response>

Source§

fn handle_set_pauser(deps: DepsMut<'_>, address: Addr) -> StdResult<Response>

Source§

fn handle_remove_pauser(deps: DepsMut<'_>, address: Addr) -> StdResult<Response>

Source§

fn query_status<T: Serialize>( deps: Deps<'_>, features: Vec<T>, ) -> StdResult<Binary>

Source§

fn query_is_pauser(deps: Deps<'_>, address: Addr) -> StdResult<Binary>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.