Mercurial > core / rust/lib/krypt/src/lib.rs
changeset 698: |
96958d3eb5b0 |
parent: |
3d78bed56188
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 //! lib.rs --- Krypt Key Management Library 7 use obj::{AuthConfig, Configure, DatabaseConfig, Objective, Result}; 8 use serde::{Deserialize, Serialize}; 9 use std::{fs, path::PathBuf}; 14 #[derive(Serialize, Deserialize, Hash, Debug, Clone, Default)] 15 pub struct KryptConfig { 21 pub fn load_file(path: PathBuf) -> Result<KryptConfig> { 22 match fs::read_to_string(path) { 23 Ok(cfg) => KryptConfig::from_json_str(&cfg), 24 Err(e) => Err(e.into()), 29 impl Objective for KryptConfig {} 30 impl Configure for KryptConfig {}