pub fn datetime_parse<S>(dt: S) -> Result<Value<'a>, TOMLError> where S: Into<&'a str> {
    let datetime = dt.into();
    let p = Parser::new();
    match p.date_time(datetime) {
      (_, IResult::Done(i, o)) => {
        let result = Value::DateTime(o);
        if i.len() > 0 || !result.validate() {
          return Result::Err(TOMLError::new(format!("Error parsing string as datetime. Argument: {}", datetime)));
        } else {
          return Result::Ok(result);
        }
      },
      (_,_) => return Result::Err(TOMLError::new(format!("Error parsing string as datetime. Argument: {}", datetime))),
    }
  }
/// Convenience function for creating a `Value::DateTime` from a sinle string value.
///
/// # Examples
///
/// ```
/// use tomllib::types::{Value, DateTime, Date, Time, TimeOffset, TimeOffsetAmount};
///
/// assert_eq!(Value::DateTime(DateTime::new(Date::from_str("2012", "06", "12").unwrap(),
///   Some(Time::from_str("02", "03", "04", Some("0864".into()), Some(TimeOffset::Time(TimeOffsetAmount::from_str(
///     "+", "10", "30"
///   ).unwrap()))).unwrap()))),
///   Value::datetime_parse("2012-06-12T02:03:04.0864+10:30").unwrap());
/// ```
Convenience function for creating a `Value::DateTime` from a sinle string value.
Convenience function for creating a ` Value :: DateTime ` from a sinle string value .
pub fn datetime_parse<S>(dt: S) -> Result<Value<'a>, TOMLError> where S: Into<&'a str> {
    let datetime = dt.into();
    let p = Parser::new();
    match p.date_time(datetime) {
      (_, IResult::Done(i, o)) => {
        let result = Value::DateTime(o);
        if i.len() > 0 || !result.validate() {
          return Result::Err(TOMLError::new(format!("Error parsing string as datetime. Argument: {}", datetime)));
        } else {
          return Result::Ok(result);
        }
      },
      (_,_) => return Result::Err(TOMLError::new(format!("Error parsing string as datetime. Argument: {}", datetime))),
    }
  }
pub fn datetime_parse < S > ( dt : S ) -> Result < Value < ' a > , TOMLError > where S : Into < & ' a str > { let datetime = dt . into ( ) ; let p = Parser :: new ( ) ; match p . date_time ( datetime ) { ( _ , IResult :: Done ( i , o ) ) => { let result = Value :: DateTime ( o ) ; if i . len ( ) > 0 || ! result . validate ( ) { return Result :: Err ( TOMLError :: new ( format ! ( " " datetime ) ) ) ; } else { return Result :: Ok ( result ) ; } } , ( _ , _ ) => return Result :: Err ( TOMLError :: new ( format ! ( " " datetime ) ) ) , } }
Convenience function for creating a `Value::DateTime` from a sinle string value.
Convenience function for creating a ` Value :: DateTime ` from a sinle string value .
dt
S
dt
S
examples
```
use tomllib::types::{Value, DateTime, Date, Time, TimeOffset, TimeOffsetAmount}.


` ` ` use tomllib :: types :: { Value DateTime Date Time TimeOffset TimeOffsetAmount } .