Commit graph

8 commits

Author SHA1 Message Date
Jonathan Johnson
244797110e
Added to_ variants for into_ functions 2024-01-02 15:07:06 -08:00
Jonathan Johnson
83e44912ee
ReadOnly<T>, Owned<T>, IntoSource<T>, more
Closes #98

This finishes my initial refactoring of the dynamic system to add
support for several dataflows including:

- Pure data sources that can be implemented using an `Owned<T>` at the
  root of a graph of `Dynamic<U>`/`DynamicReader<U>`s.
- Read-only data sinks. I thought this would be more useful across other
  widgets, but in general, Progress and Label seem like the only types
  that this applies to currently.
- The ability to mix/match Dynamic/DynamicReader in tuple-based
  for_each/map_each.
2024-01-02 14:36:53 -08:00
Jonathan Johnson
e70e92726c
Source<T> + Destination<T> (breaking)
Refs #98

This refactor overhauls the reactive system to move all the reactive
methods to traits. The side effect of this change is that now
DynamicReader's API is the same as Dynamic's API, but because it only
implements Source<T>, DynamicReader does not offer any mutation
functions.

While it's unfortunate to have more traits to include to use Cushy, this
seems like the best option, and it offers a path to try to integrate
this into the tuple ForEach/MapEach traits. Unfortunately, my attempt at
doing those in this set of changes led to issues specifying generic
associated lifetimes for the DynamicGuard. But, I was also in the middle
of this larger refactoring, so it might be that a fresh attempt will
succeed.
2024-01-02 09:00:29 -08:00
Jonathan Johnson
df479e983e
Renaming crate to Cushy
Refs #117
2023-12-27 19:02:59 -08:00
Jonathan Johnson
01e04a4eb9
Improving the readmes a bit 2023-12-15 14:31:44 -08:00
Jonathan Johnson
80ba184c15
Removing centered from readme example
Until #78 is addressed.
2023-11-14 20:41:04 -08:00
Jonathan Johnson
4a4bc5de1a
Added slidable enum demo
Also moved into_button to MakeWidget
2023-11-14 11:44:32 -08:00
Jonathan Johnson
4c7c3be5ba
Helpers galore 2023-11-14 09:31:56 -08:00