pub fn parse_strict(s: &str) -> Result<Sdc, Error> {
    let mut parser = sdc_parser_strict();
    let (ret, rest) = parser
        .parse(s)
        .map_err::<combine::error::StringStreamError, _>(Into::into)?;

    if rest.is_empty() {
        Ok(ret)
    } else {
        Err(Error {
            inner: Context::new(ErrorKind::Interrupt(InterruptError {
                parsed: ret,
                rest: String::from(rest),
            })),
        })
    }
}
/// Parse SDC string strictly
///
/// This function fails if the input is not valid SDC.
///
/// # Examples
///
/// ```
/// use sdc_parser::{self, sdc};
///
/// let result = sdc_parser::parse_strict("current_instance duv").unwrap();
///
/// let expect = sdc::Sdc {
///     commands: vec![sdc::Command::CurrentInstance(
///         sdc::CurrentInstance {
///             instance: Some(String::from("duv"))
///         }
///     )]
/// };
/// assert_eq!(expect, result);
/// ```
Parse SDC string strictly
This function fails if the input is not valid SDC.
Parse SDC string strictly This function fails if the input is not valid SDC .
pub fn parse_strict(s: &str) -> Result<Sdc, Error> {
    let mut parser = sdc_parser_strict();
    let (ret, rest) = parser
        .parse(s)
        .map_err::<combine::error::StringStreamError, _>(Into::into)?;
    if rest.is_empty() {
        Ok(ret)
    } else {
        Err(Error {
            inner: Context::new(ErrorKind::Interrupt(InterruptError {
                parsed: ret,
                rest: String::from(rest),
            })),
        })
    }
}
pub fn parse_strict ( s : & str ) -> Result < Sdc , Error > { let mut parser = sdc_parser_strict ( ) ; let ( ret , rest ) = parser . parse ( s ) . map_err :: < combine :: error :: StringStreamError , _ > ( Into :: into ) ? ; if rest . is_empty ( ) { Ok ( ret ) } else { Err ( Error { inner : Context :: new ( ErrorKind :: Interrupt ( InterruptError { parsed : ret , rest : String :: from ( rest ) , } ) ) , } ) } }
Parse SDC string strictly
This function fails if the input is not valid SDC.
Parse SDC string strictly This function fails if the input is not valid SDC .
s
&str
s
&str
examples
```
use sdc_parser::{self, sdc}.

let result = sdc_parser::parse_strict("current_instance duv").unwrap().

let expect = sdc::Sdc {
commands: vec![sdc::Command::CurrentInstance(
sdc::CurrentInstance {
instance: Some(String::from("duv"))
}
)]
};
assert_eq!(expect, result);
```
` ` ` use sdc_parser :: { self sdc } . let result = sdc_parser :: parse_strict ( " current_instance duv " ) . unwrap () . let expect = sdc :: Sdc { commands : vec! [ sdc :: Command :: CurrentInstance ( sdc :: CurrentInstance { instance : Some ( String :: from ( " duv " )) } ) ] } ; assert_eq! ( expect result ) ; ` ` `