pub fn verify(&self) -> Result<(), VerifyError> {
        if let Some(&Node::Command(ref command)) = self.commands.first().map(|n| &**n) {
            for expected in &command.parameters {
                if let Node::Parameter(ref param) = **expected {
                    let name = &param.node.name;
                    if param.required && !self.parameters.contains_key(name) {
                        return Err(VerifyError::MissingParameter(name.clone()));
                    }
                } else {
                    unreachable!();
                }
            }
            Ok(())
        } else {
            Err(VerifyError::NoCommandAccepted)
        }
    }
/// Verify that the parser is in a valid state with
/// respect to having accepted a command and all
/// required parameters.
Verify that the parser is in a valid state with
respect to having accepted a command and all
required parameters.
Verify that the parser is in a valid state with respect to having accepted a command and all required parameters .
pub fn verify(&self) -> Result<(), VerifyError> {
        if let Some(&Node::Command(ref command)) = self.commands.first().map(|n| &**n) {
            for expected in &command.parameters {
                if let Node::Parameter(ref param) = **expected {
                    let name = &param.node.name;
                    if param.required && !self.parameters.contains_key(name) {
                        return Err(VerifyError::MissingParameter(name.clone()));
                    }
                } else {
                    unreachable!();
                }
            }
            Ok(())
        } else {
            Err(VerifyError::NoCommandAccepted)
        }
    }
pub fn verify ( & self ) -> Result < ( ) , VerifyError > { if let Some ( & Node :: Command ( ref command ) ) = self . commands . first ( ) . map ( | n | & * * n ) { for expected in & command . parameters { if let Node :: Parameter ( ref param ) = * * expected { let name = & param . node . name ; if param . required && ! self . parameters . contains_key ( name ) { return Err ( VerifyError :: MissingParameter ( name . clone ( ) ) ) ; } } else { unreachable ! ( ) ; } } Ok ( ( ) ) } else { Err ( VerifyError :: NoCommandAccepted ) } }
Verify that the parser is in a valid state with
respect to having accepted a command and all
required parameters.
Verify that the parser is in a valid state with respect to having accepted a command and all required parameters .
&self
&self