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: SourceLocationcall: 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<'a>(
&'a self,
source: &'a [u8],
) -> Option<&'a str>
pub fn get_installed_enum_value<'a>( &'a self, source: &'a [u8], ) -> Option<&'a 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)
Sourcepub fn enum_value(&self) -> Option<&str>
pub fn enum_value(&self) -> Option<&str>
Get the enum value (for ArraySubscript, OverrideProperty, and DirectInstall)
Trait Implementations§
Source§impl Clone for ParamSpecAssignment
impl Clone for ParamSpecAssignment
Source§fn clone(&self) -> ParamSpecAssignment
fn clone(&self) -> ParamSpecAssignment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more