hermes_cli_components/impls/parse/
delegate.rs

1use core::marker::PhantomData;
2
3use cgp::core::component::DelegateComponent;
4use cgp::core::error::HasErrorType;
5
6use crate::traits::parse::ArgParser;
7
8pub struct DelegateArgParsers<Components>(pub PhantomData<Components>);
9
10impl<App, Args, Tag, Components, Delegate> ArgParser<App, Args, Tag>
11    for DelegateArgParsers<Components>
12where
13    App: HasErrorType,
14    Components: DelegateComponent<(Args, Tag), Delegate = Delegate>,
15    Delegate: ArgParser<App, Args, Tag>,
16{
17    type Parsed = Delegate::Parsed;
18
19    fn parse_arg(
20        app: &App,
21        args: &Args,
22        tag: PhantomData<Tag>,
23    ) -> Result<Self::Parsed, App::Error> {
24        Delegate::parse_arg(app, args, tag)
25    }
26}