FeaturesModule

Trait FeaturesModule 

Source
pub trait FeaturesModule: ContractBase + Sized {
    // Required methods
    fn get_feature_flag(&self, feature_name: FeatureName<'_>) -> u8;
    fn set_feature_flag(&self, feature_name: FeatureName<'_>, value: u8);

    // Provided methods
    fn check_feature_on(&self, feature_name: &'static [u8], default: bool) { ... }
    fn set_feature_flag_endpoint(
        &self,
        feature_name: Vec<u8>,
        value: bool,
    ) -> SCResult<()> { ... }
}
Expand description

Standard module for managing feature flags.

Required Methods§

Source

fn get_feature_flag(&self, feature_name: FeatureName<'_>) -> u8

Source

fn set_feature_flag(&self, feature_name: FeatureName<'_>, value: u8)

Provided Methods§

Source

fn check_feature_on(&self, feature_name: &'static [u8], default: bool)

Source

fn set_feature_flag_endpoint( &self, feature_name: Vec<u8>, value: bool, ) -> SCResult<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C> FeaturesModule for C
where C: AutoImpl,