pub struct LongRangeAttribute { /* private fields */ }Implementations§
Source§impl LongRangeAttribute
impl LongRangeAttribute
Sourcepub fn new(
name: CheetahString,
changeable: bool,
min: i64,
max: i64,
default_value: i64,
) -> Self
pub fn new( name: CheetahString, changeable: bool, min: i64, max: i64, default_value: i64, ) -> Self
Creates a long attribute with inclusive range bounds.
§Arguments
name- The name of the attributechangeable- Whether the attribute can be changed after creationmin- Minimum allowed value (inclusive)max- Maximum allowed value (inclusive)default_value- Default value for this attribute
§Returns
A new LongRangeAttribute without validating its bounds or default value.
Values are checked against the range by Attribute::verify.
Sourcepub fn default_value(&self) -> i64
pub fn default_value(&self) -> i64
Get the default value for this attribute
Trait Implementations§
Source§impl Attribute for LongRangeAttribute
impl Attribute for LongRangeAttribute
Source§fn verify(&self, value: &str) -> Result<(), String>
fn verify(&self, value: &str) -> Result<(), String>
Verify that the provided string value is valid for this attribute.
Implementations should validate according to their specific rules.
Source§fn name(&self) -> &CheetahString
fn name(&self) -> &CheetahString
Get the name of this attribute.
Source§fn is_changeable(&self) -> bool
fn is_changeable(&self) -> bool
Check if this attribute can be changed after creation.
Source§impl Clone for LongRangeAttribute
impl Clone for LongRangeAttribute
Auto Trait Implementations§
impl Freeze for LongRangeAttribute
impl RefUnwindSafe for LongRangeAttribute
impl Send for LongRangeAttribute
impl Sync for LongRangeAttribute
impl Unpin for LongRangeAttribute
impl UnsafeUnpin for LongRangeAttribute
impl UnwindSafe for LongRangeAttribute
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