valid_toml 0.0.2

Provides the ability to load a TOML file with validation.
Documentation
/* Copyright 2016 Joshua Gentry
 *
 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 * option. This file may not be copied, modified, or distributed
 * except according to those terms.
 */
use std::collections::LinkedList;
use enums::{Error, Warning};

//*************************************************************************************************
/// This object contains all the problems that occured while loading a TOML file.
#[derive(Debug)]
pub struct Issues
{
    //---------------------------------------------------------------------------------------------
    /// The list of errors that blocked the file from being loaded.
    pub errors : LinkedList<Error>,

    //---------------------------------------------------------------------------------------------
    /// The list of items that were missing from the file but that have default values.
    pub warnings : LinkedList<Warning>
}

impl Issues
{
    //*********************************************************************************************
    /// Create a new instance of the object.
    pub fn new() -> Issues
    {
        Issues {
            errors   : LinkedList::new(),
            warnings : LinkedList::new()
        }
    }

    //*********************************************************************************************
    /// Helper method to check if there are any error issues.
    pub fn has_errors(&self) -> bool
    {
        self.errors.len() > 0
    }
}