config: Teach reader about new builder_postprocess attribute
The builder_postprocess attribute will be used to allow toml
to specify additional steps to perform after glib::Object::new()
but before returning from *Builder::build().
@@ -81,6 +81,7 @@ pub struct GObject {
pub manual_traits: Vec<String>,
pub align: Option<u32>,
pub generate_builder: bool,
+ pub builder_postprocess: Option<String>,
pub init_function_expression: Option<String>,
pub clear_function_expression: Option<String>,
}
@@ -112,6 +113,7 @@ impl Default for GObject {
manual_traits: Vec::default(),
align: None,
generate_builder: false,
+ builder_postprocess: None,
init_function_expression: None,
clear_function_expression: None,
}
@@ -200,6 +202,7 @@ fn parse_object(
"manual_traits",
"align",
"generate_builder",
+ "builder_postprocess",
"init_function_expression",
"clear_function_expression",
],
@@ -307,6 +310,10 @@ fn parse_object(
.lookup("generate_builder")
.and_then(Value::as_bool)
.unwrap_or(false);
+ let builder_postprocess = toml_object
+ .lookup("builder_postprocess")
+ .and_then(Value::as_str)
+ .map(String::from);
let init_function_expression = toml_object
.lookup("init_function_expression")
.and_then(Value::as_str)
@@ -367,6 +374,7 @@ fn parse_object(
manual_traits,
align,
generate_builder,
+ builder_postprocess,
init_function_expression,
clear_function_expression,
}
