pub fn validate(flags: &Flags) -> Result {
        if flags.mtu < 576 {
            return Err(ParseError::OutOfRangeError("MTU", "[576, 65535]"));
        }
        let mut publish = None;
        if let Some(p) = &flags.publish {
            publish = Some(p.parse()?);
        }
        let src = flags.src.parse()?;
        let dst = flags.dst.parse()?;

        Ok(Opts {
            verbose: flags.verbose,
            vverbose: flags.vverbose,
            mtu: flags.mtu,
            inter: flags.inter.clone(),
            publish,
            src,
            dst,
        })
    }
/// Validates flags and creates a new `Opts`.
Validates flags and creates a new `Opts`.
Validates flags and creates a new ` Opts ` .
pub fn validate(flags: &Flags) -> Result {
        if flags.mtu < 576 {
            return Err(ParseError::OutOfRangeError("MTU", "[576, 65535]"));
        }
        let mut publish = None;
        if let Some(p) = &flags.publish {
            publish = Some(p.parse()?);
        }
        let src = flags.src.parse()?;
        let dst = flags.dst.parse()?;
        Ok(Opts {
            verbose: flags.verbose,
            vverbose: flags.vverbose,
            mtu: flags.mtu,
            inter: flags.inter.clone(),
            publish,
            src,
            dst,
        })
    }
pub fn validate ( flags : & Flags ) -> Result { if flags . mtu < 576 { return Err ( ParseError :: OutOfRangeError ( " " , " " ) ) ; } let mut publish = None ; if let Some ( p ) = & flags . publish { publish = Some ( p . parse ( ) ? ) ; } let src = flags . src . parse ( ) ? ; let dst = flags . dst . parse ( ) ? ; Ok ( Opts { verbose : flags . verbose , vverbose : flags . vverbose , mtu : flags . mtu , inter : flags . inter . clone ( ) , publish , src , dst , } ) }
Validates flags and creates a new `Opts`.
Validates flags and creates a new ` Opts ` .
flags
&Flags