Crate glib_macros

Source

Macros§

clone
Macro for passing variables as strong or weak references into a closure.
closure
Macro for creating a Closure object. This is a wrapper around Closure::new that automatically type checks its arguments at run-time.
closure_local
The same as closure! but uses Closure::new_local as a constructor. This is useful for closures which can’t be sent across threads. See the documentation of closure! for details.
cstr_bytes

Attribute Macros§

async_test
An attribute macro for writing asynchronous test functions.
derived_properties
When applied to ObjectImpl
flags
Attribute macro for defining flags using the bitflags crate. This macro will also define a GFlags::type_ function and the glib::Value traits.
object_interface
Macro for boilerplate of ObjectInterface implementations.
object_subclass
Macro for boilerplate of ObjectSubclass implementations.

Derive Macros§

Boxed
Derive macro for defining a BoxedType::type_ function and the glib::Value traits. Optionally, the type can be marked as nullable to get an implementation of glib::value::ToValueOptional.
Downgrade
Macro for deriving implementations of glib::clone::Downgrade and glib::clone::Upgrade traits and a weak type.
Enum
Derive macro to register a Rust enum in the GLib type system and derive the glib::Value traits.
ErrorDomain
Derive macro for defining a GLib error domain and its associated ErrorDomain trait.
Properties
This macro enables you to derive object properties in a quick way.
SharedBoxed
Derive macro for defining a SharedType::get_type function and the glib::Value traits. Optionally, the type can be marked as nullable to get an implementation of glib::value::ToValueOptional.
ValueDelegate
Example
Variant
Derive macro for serializing/deserializing custom structs/enums as glib::Variants.