gtk4/
property_expression.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{prelude::*, PropertyExpression};
6
7define_expression!(PropertyExpression, crate::ffi::GtkPropertyExpression);
8
9impl std::fmt::Debug for PropertyExpression {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        f.debug_struct("PropertyExpression")
12            .field("value_type", &self.value_type())
13            .field("is_static", &self.is_static())
14            .field("pspec", &self.pspec())
15            .field("expression", &self.expression())
16            .finish()
17    }
18}
19
20#[cfg(test)]
21mod tests {
22    use super::*;
23    use crate as gtk4;
24
25    #[test]
26    fn test_property_expression() {
27        let prop_expr = PropertyExpression::new(
28            crate::StringObject::static_type(),
29            crate::Expression::NONE,
30            "string",
31        );
32        assert!(prop_expr.is::<PropertyExpression>());
33    }
34}