2016-01-12 17:50:57 +00:00
|
|
|
use toml::Table;
|
|
|
|
|
2016-01-21 20:28:18 +00:00
|
|
|
/**
|
|
|
|
* EntryHeader
|
|
|
|
*
|
|
|
|
* This is basically a wrapper around toml::Table which provides convenience to the user of the
|
|
|
|
* librray.
|
|
|
|
*/
|
2016-01-16 18:16:41 +00:00
|
|
|
#[derive(Debug, Clone)]
|
2016-01-12 17:50:57 +00:00
|
|
|
pub struct EntryHeader {
|
|
|
|
toml: Table,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl EntryHeader {
|
|
|
|
|
2016-01-21 20:28:18 +00:00
|
|
|
/**
|
|
|
|
* Get a new header object with a already-filled toml table
|
|
|
|
*/
|
2016-01-12 17:50:57 +00:00
|
|
|
pub fn new(toml: Table) -> EntryHeader {
|
|
|
|
EntryHeader {
|
|
|
|
toml: toml,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-21 20:28:18 +00:00
|
|
|
/**
|
|
|
|
* Get the table which lives in the background
|
|
|
|
*/
|
2016-01-12 17:50:57 +00:00
|
|
|
pub fn toml(&self) -> &Table {
|
|
|
|
&self.toml
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|