masonry_core 0.4.0

Traits and types of the Masonry toolkit.
Documentation

Masonry Core

Foundational headless GUI engine of Masonry

Latest published version. Documentation build status. Apache 2.0 license.
Linebender Zulip chat. GitHub Actions CI status. Dependency staleness status.

Masonry Core provides the base GUI engine for Masonry.

Masonry's widgets are implemented in the Masonry crate, which re-exports this crate as masonry::core. Most users who wish to use Masonry for creating applications (and UI libraries) should prefer to depend on Masonry directly (i.e. the masonry crate). Masonry's documentation can be found on docs.rs.

Masonry Core provides:

  • Widget, the trait for GUI widgets in Masonry.
  • Event handling and bubbling, using types from ui-events for interoperability.
  • Communication between parent and child widgets for layout.
  • Compositing of widget's content (to be rendered using Vello).
  • Creation of accessibility trees using Accesskit.
  • APIs for widget manipulation (such as WidgetMut).
  • The Action mechanism by which widgets send events to the application.

Details of many of these can be found in the Pass System article.

If you're writing a library in the Masonry ecosystem, you should depend on masonry_core directly where possible (instead of depending on masonry). This will allow applications using your library to have greater compilation parallelism. Cases where this apply include:

  • Writing an alternative driver for Masonry (alike to Masonry Winit).
  • Witing a library containing one or more custom widget (such as a 2d mapping widget).

Masonry Core can also be used by by applications wishing to not use Masonry's provided set of widgets, so as to have more control. This can be especially useful if you wish to exactly match the appearance of an existing library, or enforce following a specific design guide, which Masonry's widgets may not always allow. Masonry Core provides a useful shared set of functionality to implement alternative widget libraries. Note that Masonry Core is currently focused primarily on the main Masonry crate itself, as we're not aware of any projects using Masonry Core as described in this paragraph.

Minimum supported Rust Version (MSRV)

This version of Masonry Core has been verified to compile with Rust 1.88 and later.

Future versions of Masonry Core might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Community

Discussion of Masonry Core development happens in the Linebender Zulip, specifically the #masonry channel. All public content can be read without logging in.

Contributions are welcome by pull request. The Rust code of conduct applies.

License

Licensed under the Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0)