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;csspub use adw;libadwaitapub use panel;libpanelpub 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
ActionNamewith state and target type. - new_
stateless_ action - Create a new type that implements
ActionNamewithout 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::Applicationthat’s used internally byRelmAppif thelibadwaitafeature is enabled. - main_
application - Returns the global
gtk::Applicationthat’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-
Sendfutures. - spawn_
local_ with_ priority - Spawns a thread-local future on GLib’s executor, for non-
Sendfutures.
Attribute Macros§
- component
macros - Macro that implements
relm4::Componentorrelm4::SimpleComponentand generates the corresponding widgets struct. - factory
macros - Macro that implements
relm4::factory::FactoryComponentand generates the corresponding widgets struct. - widget_
template macros - A macro to generate widget templates.