Params

Struct Params 

Source
pub struct Params {
    pub integer: NumberKind,
    pub derived_traits: Option<DerivedTraits>,
    pub vis: Visibility,
    pub ident: Ident,
    pub as_soft_or_hard: Option<AsSoftOrHard>,
    pub behavior: BehaviorArg,
    pub default_val: Option<NumberValue>,
    pub lower_limit_val: NumberValue,
    pub upper_limit_val: NumberValue,
    pub full_coverage: bool,
    pub exact_values: Option<Vec<NumberValue>>,
    pub valid_ranges: Option<Vec<NumberValueRange>>,
}

Fields§

§integer: NumberKind§derived_traits: Option<DerivedTraits>§vis: Visibility§ident: Ident§as_soft_or_hard: Option<AsSoftOrHard>§behavior: BehaviorArg§default_val: Option<NumberValue>§lower_limit_val: NumberValue§upper_limit_val: NumberValue§full_coverage: bool§exact_values: Option<Vec<NumberValue>>§valid_ranges: Option<Vec<NumberValueRange>>

Implementations§

Source§

impl Params

Source

pub fn mod_ident(&self) -> Ident

Source

pub fn guard_ident(&self) -> Ident

Source

pub fn value_ident(&self) -> Ident

Source

pub fn other_ident(&self, other_name: &Ident) -> Ident

Source

pub fn default_val_token(&self) -> TokenStream

Source

pub fn lower_limit_token(&self) -> TokenStream

Output the lower limit value as a bare literal in a token stream.

Source

pub fn upper_limit_token(&self) -> TokenStream

Output the upper limit value as a bare literal in a token stream.

Source

pub fn first_uniq_val(&self) -> NumberValue

Source

pub fn last_uniq_val(&self) -> NumberValue

Source

pub fn check_if_out_of_bounds<T: Spanned + ToTokens>( &self, ast: &T, value: NumberValue, ) -> Result<()>

Validate that an arbitrary value is within the lower and upper limit.

Source

pub fn is_signed(&self) -> bool

Source

pub fn is_u16_or_smaller(&self) -> bool

Check if the number kind is u16 or smaller.

Source

pub fn is_u16_or_larger(&self) -> bool

Check if the number kind is u16 or larger.

Source

pub fn is_u32_or_smaller(&self) -> bool

Check if the number kind is u32 or smaller.

Source

pub fn is_u32_or_larger(&self) -> bool

Check if the number kind is u32 or larger.

Source

pub fn is_u64_or_smaller(&self) -> bool

Check if the number kind is u64 or smaller.

Source

pub fn is_u64_or_larger(&self) -> bool

Check if the number kind is u64 or larger.

Source

pub fn is_usize_or_smaller(&self) -> bool

Source

pub fn is_usize_or_larger(&self) -> bool

Source

pub fn is_u128_or_smaller(&self) -> bool

Check if the number kind is u128 or smaller.

Source

pub fn is_i16_or_smaller(&self) -> bool

Source

pub fn is_i16_or_larger(&self) -> bool

Source

pub fn is_i32_or_smaller(&self) -> bool

Source

pub fn is_i32_or_larger(&self) -> bool

Source

pub fn is_i64_or_smaller(&self) -> bool

Source

pub fn is_i64_or_larger(&self) -> bool

Source

pub fn is_isize_or_smaller(&self) -> bool

Source

pub fn is_isize_or_larger(&self) -> bool

Source

pub fn is_i128_or_smaller(&self) -> bool

Trait Implementations§

Source§

impl Clone for Params

Source§

fn clone(&self) -> Params

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Params

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Params

§

impl RefUnwindSafe for Params

§

impl !Send for Params

§

impl !Sync for Params

§

impl Unpin for Params

§

impl UnwindSafe for Params

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> Variant for T
where T: Any + Clone + SendSync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert this Variant trait object to &dyn Any.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert this Variant trait object to &mut dyn Any.
Source§

fn as_boxed_any(self: Box<T>) -> Box<dyn Any>

Convert this Variant trait object to Box<dyn Any>.
Source§

fn type_name(&self) -> &'static str

Get the name of this type.
Source§

fn clone_object(&self) -> Box<dyn Variant>

Clone this Variant trait object.