summaryrefslogtreecommitdiffstats
path: root/src/util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/util.rs b/src/util.rs
index 6802e69..9f428c9 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -28,13 +28,21 @@ macro_rules! create_data_type {
pub struct $name(String, $crate::param::Parameters);
impl $name {
- fn new(raw: String, params: $crate::param::Parameters) -> $name {
+ pub fn new(raw: String, params: $crate::param::Parameters) -> $name {
$name(raw, params)
}
+ pub fn from_raw(raw: String) -> $name {
+ $name(raw, BTreeMap::new())
+ }
+
pub fn raw(&self) -> &String {
&self.0
}
+
+ pub fn into_raw(self) -> String {
+ self.0
+ }
}
impl From<Property> for $name {