You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[drive(Collection,Views)]#[collection(name="timer")]#[view(TimerIsRunning, name = "timer_by_running", condition = |document| document.contents.running)]// Creates a View that emits all Documents where running = truepubstructTimer{#[view(TimerByRunning. name = "timer_by_running")]// Creates a View, that emits the key `running`#[view(TimerIsRunning, name = "timer_by_running", when_eq = true)]// Creates a View that emits all Documents where running = truepubrunning:bool}
First argument to #[view(...)] would be the struct name of the view, following would be the properties.
Multiple attributes with the same struct name would be the same view.
I think there is more to add here, just some initial ideas. There is also probably a limit till where it makes sense to be able to derive it like so, and after which a custom implementation will be more sensible.
The text was updated successfully, but these errors were encountered:
My idea would be to allow something like:
First argument to
#[view(...)]
would be the struct name of the view, following would be the properties.Multiple attributes with the same struct name would be the same view.
I think there is more to add here, just some initial ideas. There is also probably a limit till where it makes sense to be able to derive it like so, and after which a custom implementation will be more sensible.
The text was updated successfully, but these errors were encountered: