diff options
author | Katharina Fey <kookie@spacekookie.de> | 2018-06-11 23:08:55 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2018-06-11 23:08:55 +0200 |
commit | 17e4f9d4d03dc739a77ab07e59bbb1e9420c25ee (patch) | |
tree | 75feebe2509b9ddefea66123405b7f0b5cce4bd1 /lockchain-core/src/meta.rs | |
parent | 1449971d229c9e5ec2f2dd7589db1d65129754ec (diff) |
Fixing a bug in the vault API, implementing more file
Diffstat (limited to 'lockchain-core/src/meta.rs')
-rw-r--r-- | lockchain-core/src/meta.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lockchain-core/src/meta.rs b/lockchain-core/src/meta.rs index a602e48..fa7fa81 100644 --- a/lockchain-core/src/meta.rs +++ b/lockchain-core/src/meta.rs @@ -33,10 +33,22 @@ pub struct MetaDomain { } impl MetaDomain { + /// Create a new domain space struct + pub fn new<S>(name: S) -> Self + where + S: Into<String>, + { + Self { + name: name.into(), + body: HashMap::new(), + } + } + /// Return the domain name for easy comparison pub fn name(&self) -> &str { &self.name } + /// Get the number of items in this domain pub fn size(&self) -> usize { self.body.len() |