pub struct BooleanAttribute { /* private fields */ }
Implementations§
Source§impl BooleanAttribute
impl BooleanAttribute
Sourcepub fn new(name: CheetahString, changeable: bool, default_value: bool) -> Self
pub fn new(name: CheetahString, changeable: bool, default_value: bool) -> 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) -> bool
pub fn default_value(&self) -> bool
Get the default value for this attribute
Trait Implementations§
Source§impl Attribute for BooleanAttribute
impl Attribute for BooleanAttribute
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 BooleanAttribute
impl Clone for BooleanAttribute
Source§fn clone(&self) -> BooleanAttribute
fn clone(&self) -> BooleanAttribute
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 BooleanAttribute
impl RefUnwindSafe for BooleanAttribute
impl Send for BooleanAttribute
impl Sync for BooleanAttribute
impl Unpin for BooleanAttribute
impl UnwindSafe for BooleanAttribute
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