pub struct Attribute {
pub name: String,
pub is: Option<AccessorType>,
pub isa: Option<String>,
pub default: bool,
pub required: bool,
pub accessor_name: String,
pub location: ByteSpan,
pub builder: Option<String>,
pub coerce: bool,
pub predicate: Option<String>,
pub clearer: Option<String>,
pub trigger: bool,
}Expand description
A Moose/Moo attribute declared via has.
Fields§
§name: StringAttribute name (e.g., name from has 'name' => (...))
is: Option<AccessorType>Accessor mode
isa: Option<String>Type constraint string (e.g., Str, ArrayRef[Int])
default: boolWhether a default value is specified
required: boolWhether required => 1 is set
accessor_name: StringName of the accessor method (may differ from attribute name)
location: ByteSpanSource location of the has declaration
builder: Option<String>Builder method name. builder => 1 derives _build_<attr>, a string names the method.
coerce: boolWhether a coercion is applied (coerce => 1)
predicate: Option<String>Predicate method name. predicate => 1 derives has_<attr>.
clearer: Option<String>Clearer method name. clearer => 1 derives clear_<attr>.
trigger: boolWhether a trigger is set (trigger => \&sub)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
impl UnwindSafe for Attribute
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