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
impl Params
pub fn mod_ident(&self) -> Ident
pub fn guard_ident(&self) -> Ident
pub fn value_ident(&self) -> Ident
pub fn other_ident(&self, other_name: &Ident) -> Ident
pub fn default_val_token(&self) -> TokenStream
Sourcepub fn lower_limit_token(&self) -> TokenStream
pub fn lower_limit_token(&self) -> TokenStream
Output the lower limit value as a bare literal in a token stream.
Sourcepub fn upper_limit_token(&self) -> TokenStream
pub fn upper_limit_token(&self) -> TokenStream
Output the upper limit value as a bare literal in a token stream.
pub fn first_uniq_val(&self) -> NumberValue
pub fn last_uniq_val(&self) -> NumberValue
Sourcepub fn check_if_out_of_bounds<T: Spanned + ToTokens>(
&self,
ast: &T,
value: NumberValue,
) -> Result<()>
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.
pub fn is_signed(&self) -> bool
Sourcepub fn is_u16_or_smaller(&self) -> bool
pub fn is_u16_or_smaller(&self) -> bool
Check if the number kind is u16 or smaller.
Sourcepub fn is_u16_or_larger(&self) -> bool
pub fn is_u16_or_larger(&self) -> bool
Check if the number kind is u16 or larger.
Sourcepub fn is_u32_or_smaller(&self) -> bool
pub fn is_u32_or_smaller(&self) -> bool
Check if the number kind is u32 or smaller.
Sourcepub fn is_u32_or_larger(&self) -> bool
pub fn is_u32_or_larger(&self) -> bool
Check if the number kind is u32 or larger.
Sourcepub fn is_u64_or_smaller(&self) -> bool
pub fn is_u64_or_smaller(&self) -> bool
Check if the number kind is u64 or smaller.
Sourcepub fn is_u64_or_larger(&self) -> bool
pub fn is_u64_or_larger(&self) -> bool
Check if the number kind is u64 or larger.
pub fn is_usize_or_smaller(&self) -> bool
pub fn is_usize_or_larger(&self) -> bool
Sourcepub fn is_u128_or_smaller(&self) -> bool
pub fn is_u128_or_smaller(&self) -> bool
Check if the number kind is u128 or smaller.
pub fn is_i16_or_smaller(&self) -> bool
pub fn is_i16_or_larger(&self) -> bool
pub fn is_i32_or_smaller(&self) -> bool
pub fn is_i32_or_larger(&self) -> bool
pub fn is_i64_or_smaller(&self) -> bool
pub fn is_i64_or_larger(&self) -> bool
pub fn is_isize_or_smaller(&self) -> bool
pub fn is_isize_or_larger(&self) -> bool
pub fn is_i128_or_smaller(&self) -> bool
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.