selector.rs 741 B

12345678910111213141516171819202122232425
  1. use crate::Atom;
  2. // =====================================
  3. // Selectors
  4. // =====================================
  5. pub struct SelectorApi {}
  6. impl SelectorApi {
  7. pub fn get<T: PartialEq>(&self, t: &'static Atom<T>) -> &T {
  8. todo!()
  9. }
  10. }
  11. // pub struct SelectorBuilder<Out, const Built: bool> {
  12. // _p: std::marker::PhantomData<Out>,
  13. // }
  14. // impl<O> SelectorBuilder<O, false> {
  15. // pub fn getter(self, f: impl Fn(()) -> O) -> SelectorBuilder<O, true> {
  16. // todo!()
  17. // // std::rc::Rc::pin(value)
  18. // // todo!()
  19. // }
  20. // }
  21. pub struct selector<O>(pub fn(&SelectorApi) -> O);
  22. // pub struct selector<O>(pub fn(SelectorBuilder<O, false>) -> SelectorBuilder<O, true>);
  23. pub type Selector<O> = selector<O>;