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
Create a new enum attribute with the specified properties
§Arguments
name
- The name of the attributechangeable
- Whether the attribute can be changed after creationuniverse
- Set of valid values this attribute can takedefault_value
- Default value for this attribute (must be in universe)
§Returns
A new EnumAttribute instance, or an error if the default value is not in the universe
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
Source§fn clone(&self) -> LongRangeAttribute
fn clone(&self) -> LongRangeAttribute
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !Freeze for LongRangeAttribute
impl RefUnwindSafe for LongRangeAttribute
impl Send for LongRangeAttribute
impl Sync for LongRangeAttribute
impl Unpin 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