# lib3h_persistence_file [![Project](https://img.shields.io/badge/project-holochain-blue.svg?style=flat-square)](http://holochain.org/) [![Chat](https://img.shields.io/badge/chat-chat%2eholochain%2enet-blue.svg?style=flat-square)](https://chat.holochain.net) [![Twitter Follow](https://img.shields.io/twitter/follow/holochain.svg?style=social&label=Follow)](https://twitter.com/holochain) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) ## Overview Filesystem persistence implementations for lib3h and holochain. Provides content addressable storage (CAS) and entity attribute value (index) associations using hiearchical based filesystem storage. ## Usage Add `lib3h_persistence_file` crate to your `Cargo.toml`. Below is a stub for creating a storage unit and adding some content. ```rust use lib3h_persistence_file::cas::file::FilesystemStorage; use tempfile::tempdir; pub fn init() -> FilesystemStorage { let dir = tempdir().expect("Could not create a tempdir for CAS."); let store = FilesystemStorage::new(dir.path()).unwrap(); store.add().expect("added some content"); store } ``` ## Contribute Holochain is an open source project. We welcome all sorts of participation and are actively working on increasing surface area to accept it. Please see our [contributing guidelines](https://github.com/holochain/org/blob/master/CONTRIBUTING.md) for our general practices and protocols on participating in the community. ## License [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) Copyright (C) 2019, Holochain Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.