-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathlib.rs
52 lines (44 loc) · 1.93 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! The crate implements the [Web Native File System](https://whitepaper.fission.codes/file-system/file-system-basics) (WNFS) version 2.
//!
//! The Web Native File System is a file system written for the web.
//! It is versioned, logged, programmable, has strong-yet-flexible security, and is fully controlled by the end user.
//! Service providers can validate writes without reading the contents of the file system, and minimal metadata is leaked.
//!
//! This implementation is based off of the [typescript implementation](https://github.com/fission-suite/webnative/tree/matheus23/wnfs2/src/fs).
//! It exposes an immutable API, extending WNFS immutable nature to the in-memory representation of the file system.
#![deny(unsafe_code)]
pub mod error;
pub mod private;
pub mod public;
pub(crate) mod root_tree;
pub mod traits;
mod utils;
pub mod rand_core {
pub use rand_core::RngCore;
}
pub mod common {
pub use wnfs_common::*;
}
pub mod hamt {
pub use wnfs_hamt::*;
}
pub mod nameaccumulator {
pub use wnfs_nameaccumulator::*;
}
//--------------------------------------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------------------------------------
const VERSION: semver::Version = semver::Version::new(0, 2, 0);
//--------------------------------------------------------------------------------------------------
// Types
//--------------------------------------------------------------------------------------------------
/// The result of an basic get operation.
pub(crate) enum SearchResult<T> {
Missing(T, usize),
NotADir(T, usize),
Found(T),
}
//--------------------------------------------------------------------------------------------------
// Constants
//--------------------------------------------------------------------------------------------------
pub const WNFS_VERSION: semver::Version = semver::Version::new(0, 2, 0);