Struct checked_rs_macro_impl::clamped::ClampParams
source · pub struct ClampParams {Show 18 fields
pub uinteger: TypePath,
pub uinteger_semi: SemiOrComma,
pub default_kw: default,
pub default_eq: Eq,
pub default_val: UIntegerArg,
pub default_semi: Option<SemiOrComma>,
pub behavior_kw: behavior,
pub behavior_eq: Eq,
pub behavior_val: BehaviorArg,
pub behavior_semi: Option<SemiOrComma>,
pub lower_kw: Option<lower>,
pub lower_eq: Option<Eq>,
pub lower_val: Option<UIntegerArg>,
pub lower_semi: Option<SemiOrComma>,
pub upper_kw: Option<upper>,
pub upper_eq: Option<Eq>,
pub upper_val: Option<UIntegerArg>,
pub upper_semi: Option<SemiOrComma>,
}Expand description
Represents the parameters of the clamped attribute.
Only the uinteger and default parameters are required.
The uinteger parameter must be first while the order of the rest is not important.
Fields§
§uinteger: TypePath§uinteger_semi: SemiOrComma§default_kw: default§default_eq: Eq§default_val: UIntegerArg§default_semi: Option<SemiOrComma>§behavior_kw: behavior§behavior_eq: Eq§behavior_val: BehaviorArg§behavior_semi: Option<SemiOrComma>§lower_kw: Option<lower>§lower_eq: Option<Eq>§lower_val: Option<UIntegerArg>§lower_semi: Option<SemiOrComma>§upper_kw: Option<upper>§upper_eq: Option<Eq>§upper_val: Option<UIntegerArg>§upper_semi: Option<SemiOrComma>Implementations§
source§impl ClampParams
impl ClampParams
sourcepub fn default_value(&self) -> u128
pub fn default_value(&self) -> u128
Interpret the default value as u128.
sourcepub fn behavior_type(&self) -> &BehaviorArg
pub fn behavior_type(&self) -> &BehaviorArg
Get the behavior type.
sourcepub fn lower_limit_value(&self) -> u128
pub fn lower_limit_value(&self) -> u128
Interpret the lower limit value as u128.
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_value(&self) -> u128
pub fn upper_limit_value(&self) -> u128
Interpret the upper limit value as u128.
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.
sourcepub fn abort_if_out_of_bounds<T: Spanned + ToTokens>(
&self,
ast: &T,
value: u128,
)
pub fn abort_if_out_of_bounds<T: Spanned + ToTokens>( &self, ast: &T, value: u128, )
Validate that an arbitrary value is within the lower and upper limit.
sourcepub fn is_u16_or_smaller(&self) -> bool
pub fn is_u16_or_smaller(&self) -> bool
Check if the unsigned integer kind is u16 or smaller.
sourcepub fn is_u16_or_larger(&self) -> bool
pub fn is_u16_or_larger(&self) -> bool
Check if the unsigned integer kind is u16 or larger.
sourcepub fn is_u32_or_smaller(&self) -> bool
pub fn is_u32_or_smaller(&self) -> bool
Check if the unsigned integer kind is u32 or smaller.
sourcepub fn is_u32_or_larger(&self) -> bool
pub fn is_u32_or_larger(&self) -> bool
Check if the unsigned integer kind is u32 or larger.
sourcepub fn is_u64_or_smaller(&self) -> bool
pub fn is_u64_or_smaller(&self) -> bool
Check if the unsigned integer kind is u64 or smaller.
sourcepub fn is_u64_or_larger(&self) -> bool
pub fn is_u64_or_larger(&self) -> bool
Check if the unsigned integer kind is u64 or larger.
sourcepub fn is_u128_or_smaller(&self) -> bool
pub fn is_u128_or_smaller(&self) -> bool
Check if the unsigned integer kind is u128 or smaller.
Trait Implementations§
source§impl Clone for ClampParams
impl Clone for ClampParams
source§fn clone(&self) -> ClampParams
fn clone(&self) -> ClampParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more