Trait ConfigOperator

Source
pub trait ConfigOperator: Sized {
    type DataTy: AsBizData<u64> + Copy + Clone;

    const MIN: u64;
    const MAX: u64;
    const DEFAULT_MAX: u64;
Show 20 methods // Required methods fn _default() -> Self; fn next(&self, index: Self::DataTy) -> Option<Self::DataTy>; fn min_val(&self) -> Self::DataTy; fn _val(&self) -> u64; fn _val_mut(&mut self, val: u64); // Provided methods fn default_value(val: Self::DataTy) -> Self { ... } fn default_range(range: impl RangeBounds<Self::DataTy>) -> Result<Self> { ... } fn default_all() -> Self { ... } fn default_all_by_max(max: Self::DataTy) -> Self { ... } fn default_array(vals: &[Self::DataTy]) -> Self { ... } fn add_array(self, vals: &[Self::DataTy]) -> Self { ... } fn add(self, index: Self::DataTy) -> Self { ... } fn add_range(self, range: impl RangeBounds<Self::DataTy>) -> Result<Self> { ... } fn merge(&self, other: &Self) -> Self { ... } fn intersection(&self, other: &Self) -> Self { ... } fn to_vec(&self) -> Vec<u64> { ... } fn contain(&self, index: Self::DataTy) -> bool { ... } fn _next(&self, index: Self::DataTy) -> Option<u64> { ... } fn _min_val(&self) -> u64 { ... } fn is_zero(&self) -> bool { ... }
}
Expand description

配置项的操作trait

Required Associated Constants§

Source

const MIN: u64

最小值:比如星期配置,则最小为星期1,即为1,即0b10,即u64的第1位为1

Source

const MAX: u64

最大值:比如星期配置,则最大为星期日,即为7,即0b10000000,即u64的第7位为1

Source

const DEFAULT_MAX: u64

满值:即全选的值,比如星期7天全选,则为二进制1111 1110

Required Associated Types§

Required Methods§

Source

fn _default() -> Self

Source

fn next(&self, index: Self::DataTy) -> Option<Self::DataTy>

Source

fn min_val(&self) -> Self::DataTy

Source

fn _val(&self) -> u64

Source

fn _val_mut(&mut self, val: u64)

Provided Methods§

Source

fn default_value(val: Self::DataTy) -> Self

Source

fn default_range(range: impl RangeBounds<Self::DataTy>) -> Result<Self>

Source

fn default_all() -> Self

Source

fn default_all_by_max(max: Self::DataTy) -> Self

Source

fn default_array(vals: &[Self::DataTy]) -> Self

Source

fn add_array(self, vals: &[Self::DataTy]) -> Self

Source

fn add(self, index: Self::DataTy) -> Self

Source

fn add_range(self, range: impl RangeBounds<Self::DataTy>) -> Result<Self>

Source

fn merge(&self, other: &Self) -> Self

生成2者的并集

Source

fn intersection(&self, other: &Self) -> Self

生成2者的交集

Source

fn to_vec(&self) -> Vec<u64>

Source

fn contain(&self, index: Self::DataTy) -> bool

Source

fn _next(&self, index: Self::DataTy) -> Option<u64>

取下一个持有值,不包括index

Source

fn _min_val(&self) -> u64

取最小的持有值

Source

fn is_zero(&self) -> bool

是否啥都没有选

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 ConfigOperator for Hours

Source§

const MIN: u64 = 0u64

Source§

const MAX: u64 = 23u64

Source§

const DEFAULT_MAX: u64 = 16_777_215u64

Source§

type DataTy = Hour

Source§

impl ConfigOperator for Minuters

Source§

const MIN: u64 = 0u64

Source§

const MAX: u64 = 59u64

Source§

const DEFAULT_MAX: u64 = 1_152_921_504_606_846_975u64

Source§

type DataTy = Minuter

Source§

impl ConfigOperator for MonthDays

Source§

const MIN: u64 = 1u64

Source§

const MAX: u64 = 31u64

Source§

const DEFAULT_MAX: u64 = 4_294_967_294u64

Source§

type DataTy = MonthDay

Source§

impl ConfigOperator for Seconds

Source§

const MIN: u64 = 0u64

Source§

const MAX: u64 = 59u64

Source§

const DEFAULT_MAX: u64 = 1_152_921_504_606_846_975u64

Source§

type DataTy = Second

Source§

impl ConfigOperator for WeekDays

Source§

const DEFAULT_MAX: u64 = 254u64

Source§

const MIN: u64 = 1u64

Source§

const MAX: u64 = 7u64

Source§

type DataTy = WeekDay