Crates.io | lockchain-core |
lib.rs | lockchain-core |
version | 0.9.0 |
source | src |
created_at | 2018-04-09 16:13:01.826735 |
updated_at | 2018-07-12 18:31:38.786066 |
description | Provides common abstractions for the lockchain crate ecoystem |
homepage | https://github.com/spacekookie/lockchain/tree/master/lockchain-core |
repository | |
max_upload_size | |
id | 59734 |
size | 40,502 |
Library of common types used in the lockchain
crate ecosystem. It exposes traits and serde-compatible generic types that are meant to be embedded into various applications. Also provides stubbed functions with unimplemented!()
macros to allow rapid prototyping or selective feature implementations.
The documentation isn't complete, if you have questions how to use it don't hesitate to open an issue. And docs PR's always welcome 💚.
The core types provided by this crate are
Vault<T>
Record<T>
Body
The last one is a trait that provides a few shared functions for backend implementations. Some might want to only keep encrypted data around while others could selectively query different fields. Some have more advanced versioning, some don't, etc. Additionally we have more types to round out a vault (Payload
, Header
, etc).
A simple implementation of a body type could look like this.
extern crate lockchain_core as lockchain;
use lockchain::traits::{Body, Encryption};
#[derive(Serialize, Deserialize)]
struct EncryptedBody {
// ... your fields here ...
}
impl Body for EncryptedBody {
// ... function implementations ...
}
impl Encryption for EncryptedBody {
// ... implement the functions ...
}
lockchain
is free software: you can redistribute it and/or modify it under the terms of the MIT Public License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT Public License for more details.
In the interest of fostering an open and welcoming environment, the lockchain
project pledges to making participation a harassment-free experience for everyone. See Code of Conduct for details. In case of violations, e-mail kookie@spacekookie.de.