cgp_dispatch/providers/matchers/
match_first_with_field_handlers.rs1use cgp_core::prelude::*;
2use cgp_handler::UseInputDelegate;
3
4use crate::providers::matchers::to_field_handlers::{
5 HasFieldHandlers, MapExtractFirstFieldAndHandle,
6};
7use crate::{
8 HandleFirstFieldValue, MatchFirstWithHandlers, MatchFirstWithHandlersMut,
9 MatchFirstWithHandlersRef,
10};
11
12pub type MatchFirstWithFieldHandlers<Provider = UseContext> =
13 UseInputDelegate<MatchFirstWithFieldHandlersInputs<Provider>>;
14
15pub type MatchFirstWithValueHandlers<Provider = UseContext> =
16 UseInputDelegate<MatchFirstWithFieldHandlersInputs<HandleFirstFieldValue<Provider>>>;
17
18pub type MatchFirstWithFieldHandlersRef<Provider = UseContext> =
19 UseInputDelegate<MatchFirstWithFieldHandlersInputsRef<Provider>>;
20
21pub type MatchFirstWithValueHandlersRef<Provider = UseContext> =
22 UseInputDelegate<MatchFirstWithFieldHandlersInputsRef<HandleFirstFieldValue<Provider>>>;
23
24pub type MatchFirstWithFieldHandlersMut<Provider = UseContext> =
25 UseInputDelegate<MatchFirstWithFieldHandlersInputsMut<Provider>>;
26
27pub type MatchFirstWithValueHandlersMut<Provider = UseContext> =
28 UseInputDelegate<MatchFirstWithFieldHandlersInputsMut<HandleFirstFieldValue<Provider>>>;
29
30delegate_components! {
31 <Input: HasFieldHandlers<MapExtractFirstFieldAndHandle<Provider>>, Args, Provider>
32 new MatchFirstWithFieldHandlersInputs<Provider> {
33 (Input, Args): MatchFirstWithHandlers<Input::Handlers>
34 }
35}
36
37delegate_components! {
38 <Input: HasFieldHandlers<MapExtractFirstFieldAndHandle<Provider>>, Args, Provider>
39 new MatchFirstWithFieldHandlersInputsRef<Provider> {
40 <'a> (&'a Input, Args):
41 MatchFirstWithHandlersRef<Input::Handlers>
42 }
43}
44
45delegate_components! {
46 <Input: HasFieldHandlers<MapExtractFirstFieldAndHandle<Provider>>, Args, Provider>
47 new MatchFirstWithFieldHandlersInputsMut<Provider> {
48 <'a> (&'a mut Input, Args):
49 MatchFirstWithHandlersMut<Input::Handlers>
50 }
51}