Skip to content

Commit

Permalink
feat(vfs) Continue the rewrite of the in-memory filesystem.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Aug 27, 2021
1 parent b66e591 commit 047256f
Show file tree
Hide file tree
Showing 13 changed files with 3,115 additions and 2,621 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions lib/vfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ thiserror = "1"
tracing = { version = "0.1" }
typetag = { version = "0.1", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"], optional = true }
slab = { version = "0.4", optional = true }

[features]
default = ["host_fs"]
host_fs = ["libc"]
mem_fs = []
default = ["host-fs"]
host-fs = ["libc"]
mem-fs = ["slab"]
enable-serde = [
"serde",
"typetag"
Expand Down
9 changes: 5 additions & 4 deletions lib/vfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ use std::io::{self, Read, Seek, Write};
use std::path::{Path, PathBuf};
use thiserror::Error;

#[cfg(all(not(feature = "host_fs"), not(feature = "mem_fs")))]
compile_error!("At least the `host_fs` or the `mem_fs` feature must be enabled. Please, pick one.");
#[cfg(all(not(feature = "host-fs"), not(feature = "mem-fs")))]
compile_error!("At least the `host-fs` or the `mem-fs` feature must be enabled. Please, pick one.");

#[cfg(feature = "host_fs")]
#[cfg(feature = "host-fs")]
pub mod host_fs;
#[cfg(feature = "mem_fs")]
#[cfg(feature = "mem-fs")]
pub mod mem_fs;

pub type Result<T> = std::result::Result<T, FsError>;

#[derive(Debug)]
#[repr(transparent)]
pub struct FileDescriptor(usize);

Expand Down
Loading

0 comments on commit 047256f

Please sign in to comment.