pub struct Property {
pub name: String,
pub type_info: Type,
pub getter: Option<Method>,
pub setter: Option<Method>,
pub is_static: bool,
pub access: &'static str,
pub instance: Option<*mut c_void>,
}Expand description
Property metadata synthesized from getter and setter methods.
Fields§
§name: StringName of the property (without get_/set_ prefix)
type_info: TypeType of the property
getter: Option<Method>Getter method (if exists)
setter: Option<Method>Setter method (if exists)
is_static: boolWhether the property is static
access: &'static strAccess modifier
instance: Option<*mut c_void>Instance pointer for instance properties
Implementations§
Source§impl Property
impl Property
Sourcepub fn from_methods(
getter: Option<Method>,
setter: Option<Method>,
) -> Option<Self>
pub fn from_methods( getter: Option<Method>, setter: Option<Method>, ) -> Option<Self>
Creates a new Property from getter and/or setter methods
Sourcepub fn with_instance(&self, instance: *mut c_void) -> Self
pub fn with_instance(&self, instance: *mut c_void) -> Self
Returns a copy of this property with the instance pointer set
Sourcepub fn has_getter(&self) -> bool
pub fn has_getter(&self) -> bool
Returns true if this property has a getter
Sourcepub fn has_setter(&self) -> bool
pub fn has_setter(&self) -> bool
Returns true if this property has a setter
Trait Implementations§
impl Send for Property
impl Sync for Property
Auto Trait Implementations§
impl Freeze for Property
impl RefUnwindSafe for Property
impl Unpin for Property
impl UnsafeUnpin for Property
impl UnwindSafe for Property
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