Derive Macro glib::Boxed

source ·
    // Attributes available to this derive:
Expand description

Derive macro for defining a BoxedType::type_ function and the glib::Value traits. Optionally, the type can be marked as nullable to get an implemention of glib::value::ToValueOptional.


use glib::prelude::*;
use glib::subclass::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq, glib::Boxed)]
#[boxed_type(name = "MyBoxed")]
struct MyBoxed(String);

#[derive(Clone, Debug, PartialEq, Eq, glib::Boxed)]
#[boxed_type(name = "MyNullableBoxed", nullable)]
struct MyNullableBoxed(String);