Expand description
Reactive state for Wayle services. Wrap a value in Property<T>
and consumers can .get() it or .watch() for a stream of changes.
use wayle_core::Property;
use futures::stream::StreamExt;
let brightness = Property::new(75u32);
brightness.set(100);
let mut changes = brightness.watch();
while let Some(level) = changes.next().await {
println!("{level}");
}Also includes D-Bus macros (unwrap_*!, watch_all!) for extracting
properties with type-safe defaults.
Enable schema for [schemars::JsonSchema] support on Property<T>.
Modules§
- paths
- XDG Base Directory path resolution.
Macros§
- remove_
and_ cancel - Removes items from a
Property<Vec<T>>whoseobject_pathmatches$target_path, cancelling theirCancellationTokenbefore removal. - unwrap_
dbus - Extracts a value from a D-Bus property
Result, returningDefault::default()on error and logging the failure atdebuglevel. - unwrap_
dbus_ or - Like
unwrap_dbus!but returns a specific fallback value instead ofDefault::default(). - watch_
all - Merges
.watch()streams from multiplePropertyfields into a single stream that clones and emits the parent struct whenever any field changes.
Structs§
- Property
- A value you can
.get()or.watch()for changes.
Constants§
Type Aliases§
- Deferred
Service - A
Propertyholding a service that initializes in the background. StartsNone, becomesSomeonce the service is ready. - Property
Stream - Stream of property value changes.