aboutsummaryrefslogtreecommitdiff
path: root/lockchain-core/src/traits.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2018-09-06 20:28:04 +0200
committerKatharina Fey <kookie@spacekookie.de>2018-09-06 20:28:04 +0200
commitddebbc0b7f45eaf07a2242fd91f1a92ee27099a9 (patch)
tree6ce7b1313f4e94f43c02102546b5f2440aed87de /lockchain-core/src/traits.rs
parentf3824b79256133374aacd910f34ed2764640b1b7 (diff)
Changing the vault trait to use Result<_, VaultError> more liberally
Diffstat (limited to 'lockchain-core/src/traits.rs')
-rw-r--r--lockchain-core/src/traits.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/lockchain-core/src/traits.rs b/lockchain-core/src/traits.rs
index efde578..13fc1b3 100644
--- a/lockchain-core/src/traits.rs
+++ b/lockchain-core/src/traits.rs
@@ -11,7 +11,8 @@
//! compilation work without external crates but not calling
//! functions at runtime.
-use initialise::Generator;
+use errors::VaultError;
+use init::Generator;
use meta::{MetaDomain, VaultMetadata};
use record::{EncryptedBody, Header, Payload, Record};
use serde::{de::DeserializeOwned, Serialize};
@@ -123,9 +124,9 @@ where
T: Body,
{
/// Consumes a vault generator to construct a vault
- fn new(cfg: Generator) -> Self;
+ fn new(Generator) -> Result<Box<Self>, VaultError>;
/// Load and open an existing vault
- fn load(name: &str, location: &str) -> Option<Box<Self>>;
+ fn load(name: &str, location: &str) -> Result<Box<Self>, VaultError>;
/// Unlock the vault for a specific user
fn authenticate(&mut self, username: &str, secret: &str) -> Token;
/// End a specific user session