Skip to main content

ParseFromFlags

Trait ParseFromFlags 

Source
pub trait ParseFromFlags: Sized {
    type Config;

    // Required methods
    fn parse_vec_as_config<I>(inputs: I) -> Self::Config
       where I: IntoIterator,
             I::Item: AsRef<str>;
    fn parse(s: &str) -> Result<Self, String>;
}

Required Associated Types§

Source

type Config

Typ konfiguracji, który zostanie zwrócony

Required Methods§

Source

fn parse_vec_as_config<I>(inputs: I) -> Self::Config
where I: IntoIterator, I::Item: AsRef<str>,

Przetwarza wektor stringów (flag) na zwalidowaną strukturę konfiguracyjną

Source

fn parse(s: &str) -> Result<Self, String>

Parsuje pojedynczego stringa (flagę CLI) na wariant Enuma. Zwraca Result, aby umożliwić obsługę lub zignorowanie nieznanych flag.

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.

Implementors§