Expand description
An idiomatic GUI library inspired by Elm and based on gtk4-rs.
Docs of related crates: relm4 | relm4-macros | relm4-components | relm4-css | gtk4-rs | gtk-rs-core | libadwaita-rs | libpanel-rs
Re-exports§
pub use component::worker::Worker;
pub use component::worker::WorkerController;
pub use component::worker::WorkerHandle;
pub use component::Component;
pub use component::ComponentBuilder;
pub use component::ComponentController;
pub use component::ComponentParts;
pub use component::Controller;
pub use component::MessageBroker;
pub use component::SimpleComponent;
pub use shared_state::Reducer;
pub use shared_state::Reducible;
pub use gtk;
pub use relm4_css as css;
css
pub use adw;
libadwaita
pub use panel;
libpanel
pub use once_cell;
pub use tokio;
Modules§
- abstractions
- A module for convenient abstractions over gtk-rs.
- actions
- Action utility.
- binding
- Easy data bindings between objects.
- component
- Components are smaller mostly independent parts of your application.
- factory
- Defines traits and data types to generate widgets from collections efficiently.
- loading_
widgets - Utilities for removing temporary widgets from async factories or components.
- prelude
- Commonly-imported traits and types.
- shared_
state - Shared state that can be accessed by many components.
- shutdown
- Cancellation mechanism used by Relm4.
- typed_
view - Typed views.
Macros§
- menu
macros
- A macro to create menus.
- new_
action_ group - Create a new type that implements
ActionGroupName
. - new_
stateful_ action - Create a new type that implements
ActionName
with state and target type. - new_
stateless_ action - Create a new type that implements
ActionName
without state or target type. - view
macros
- The
view!
macro allows you to construct your UI easily and cleanly.
Structs§
- Async
Component Sender - Contains senders to send and receive messages from a
Component
. - Async
Factory Sender - Contains senders to send and receive messages from a
Component
. - Component
Sender - Contains senders to send and receive messages from a
Component
. - Factory
Sender - Contains senders to send and receive messages from a
Component
. - Join
Handle - An owned permission to join on a task (await its termination).
- Receiver
- A Relm4 receiver receives messages from a component or worker.
- RelmApp
- An app that runs the main application.
- Sender
- A Relm4 sender sends messages to a component or worker.
- Shutdown
Receiver - Listens to shutdown signals and constructs shutdown futures.
Statics§
- RELM_
BLOCKING_ THREADS - Defines the maximum number of background threads to spawn for handling blocking tasks.
- RELM_
THREADS - Defines how many threads that Relm4 should use for background tasks.
Traits§
- Application
Builder Ext - Additional methods for
gtk::builders::ApplicationBuilder
- Container
Child - Type of children inside a container.
- Relm
Container Ext - Widget types which can have widgets attached to them.
- Relm
Iter Children Ext - Widget types which allow iteration over their children.
- Relm
List BoxExt - Additional methods for
gtk::ListBox
. - Relm
Object Ext - Trait that extends
gtk::prelude::ObjectExt
. - Relm
Remove AllExt - Widget types that allow removal of all their children.
- Relm
Remove Ext - Widget types which can have widgets removed from them.
- Relm
SetChild Ext - Widget types which allow to set or unset their child.
- Relm
Widget Ext - Trait that extends
gtk::prelude::WidgetExt
. - Widget
Ref - Get a reference to a widget.
- Widget
Template - A trait that describes a widget template.
Functions§
- channel
- Create an unbounded channel to send messages between different parts of you application.
- main_
adw_ application libadwaita
- Returns the global
adw::Application
that’s used internally byRelmApp
if thelibadwaita
feature is enabled. - main_
application - Returns the global
gtk::Application
that’s used internally byRelmApp
. - set_
global_ css - Sets a custom global stylesheet.
- set_
global_ css_ from_ file - Sets a custom global stylesheet from a file.
- set_
global_ css_ from_ file_ with_ priority - Sets a custom global stylesheet from a file, with the given priority.
- set_
global_ css_ with_ priority - Sets a custom global stylesheet, with the given priority.
- spawn
- Spawns a
Send
-able future to the shared component runtime. - spawn_
blocking - Spawns a blocking task in a background thread pool.
- spawn_
local - Spawns a thread-local future on GLib’s executor, for non-
Send
futures. - spawn_
local_ with_ priority - Spawns a thread-local future on GLib’s executor, for non-
Send
futures.
Attribute Macros§
- component
macros
- Macro that implements
relm4::Component
orrelm4::SimpleComponent
and generates the corresponding widgets struct. - factory
macros
- Macro that implements
relm4::factory::FactoryComponent
and generates the corresponding widgets struct. - widget_
template macros
- A macro to generate widget templates.