Skip to main content

Parse2

Trait Parse2 

Source
pub trait Parse2<'a, 'b, C>: Sized {
    type I: Display;

    // Required methods
    fn parse2(
        i: Init<C, Self::I>,
        k: &'static str,
        c: &C,
        p: &mut ParsedArgs<'b>,
    ) -> Result<Self, ArgParseErr<'b>>;
    fn desc2(
        i: Init<C, Self::I>,
        d: &'static str,
        k: &'static str,
        c: &C,
    ) -> [String; 4];
    fn default2(c: &C, i: Init<C, Self::I>) -> Self;
}

Required Associated Types§

Required Methods§

Source

fn parse2( i: Init<C, Self::I>, k: &'static str, c: &C, p: &mut ParsedArgs<'b>, ) -> Result<Self, ArgParseErr<'b>>

Source

fn desc2( i: Init<C, Self::I>, d: &'static str, k: &'static str, c: &C, ) -> [String; 4]

Source

fn default2(c: &C, i: Init<C, Self::I>) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, 'b, Ctx, T> Parse2<'b, 'a, Ctx> for Option<T>
where T: Parse<'a>,

Source§

type I = T

Source§

fn parse2( i: Init<Ctx, T>, k: &'static str, c: &Ctx, p: &mut ParsedArgs<'a>, ) -> Result<Option<T>, ArgParseErr<'a>>

Source§

fn desc2( i: Init<Ctx, T>, d: &'static str, k: &'static str, c: &Ctx, ) -> [String; 4]

Source§

fn default2( c: &Ctx, i: Init<Ctx, <Option<T> as Parse2<'b, 'a, Ctx>>::I>, ) -> Option<T>

Source§

impl<'a, 'b, Ctx, T> Parse2<'b, 'a, Ctx> for Vec<T>
where T: Parse<'a> + Display,

Source§

type I = DisplayVec<T>

Source§

fn parse2( i: Init<Ctx, <Vec<T> as Parse2<'b, 'a, Ctx>>::I>, k: &'static str, c: &Ctx, p: &mut ParsedArgs<'a>, ) -> Result<Vec<T>, ArgParseErr<'a>>

Source§

fn desc2( i: Init<Ctx, <Vec<T> as Parse2<'b, 'a, Ctx>>::I>, d: &'static str, k: &'static str, c: &Ctx, ) -> [String; 4]

Source§

fn default2(c: &Ctx, i: Init<Ctx, <Vec<T> as Parse2<'b, 'a, Ctx>>::I>) -> Vec<T>

Implementors§

Source§

impl<'a, 'b, C, T> Parse2<'b, 'a, C> for T
where T: Parse<'a> + Default,

Source§

type I = T

Source§

impl<'a, 'b, Ctx, T> Parse2<'b, 'a, Ctx> for OptVec<T>
where T: Parse<'a>,