pub enum ParamSpecAssignment {
ArraySubscript {
array_name: String,
enum_value: String,
statement_location: SourceLocation,
call: CallExpression,
property: Property,
install_call: Option<CallExpression>,
},
Variable {
variable_name: String,
statement_location: SourceLocation,
call: CallExpression,
property: Property,
install_call: Option<CallExpression>,
},
OverrideProperty {
enum_value: String,
statement_location: SourceLocation,
call: CallExpression,
property: Property,
},
DirectInstall {
enum_value: String,
statement_location: SourceLocation,
call: CallExpression,
property: Property,
install_call: CallExpression,
},
}Expand description
Information about a param_spec assignment found in a class_init function
Variants§
ArraySubscript
Array subscript pattern: props[PROP_X] = g_param_spec_*()
Variable
Variable pattern: param_spec = g_param_spec_*()
OverrideProperty
Override property pattern: g_object_class_override_property(class, PROP_X, “name”)
DirectInstall
Direct install: g_object_class_install_property(class, PROP_X, g_param_spec_xxx(…))
Fields
§
statement_location: SourceLocation§
call: CallExpressionThe inline g_param_spec_* call
§
install_call: CallExpressionThe enclosing g_object_class_install_property call
Implementations§
Source§impl ParamSpecAssignment
impl ParamSpecAssignment
Sourcepub fn is_installed(&self) -> bool
pub fn is_installed(&self) -> bool
Check if this param_spec assignment is installed (has an install call or is an override)
Sourcepub fn get_installed_enum_value(&self) -> Option<&str>
pub fn get_installed_enum_value(&self) -> Option<&str>
Get the enum value if this assignment is installed For Variable assignments, extracts enum value from install_property call
Sourcepub fn param_spec_call(&self) -> Option<&CallExpression>
pub fn param_spec_call(&self) -> Option<&CallExpression>
Get the g_param_spec_* call (None for OverrideProperty)
pub fn statement_location(&self) -> &SourceLocation
pub fn enum_value(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for ParamSpecAssignment
impl Clone for ParamSpecAssignment
Source§impl Debug for ParamSpecAssignment
impl Debug for ParamSpecAssignment
Auto Trait Implementations§
impl Freeze for ParamSpecAssignment
impl RefUnwindSafe for ParamSpecAssignment
impl Send for ParamSpecAssignment
impl Sync for ParamSpecAssignment
impl Unpin for ParamSpecAssignment
impl UnsafeUnpin for ParamSpecAssignment
impl UnwindSafe for ParamSpecAssignment
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