filesystem example (#2236)

This commit is contained in:
Joshua Warner
2020-09-29 11:20:14 -07:00
committed by GitHub
parent 715be68101
commit eb650f6fe0
20 changed files with 224 additions and 13 deletions

View File

@@ -127,16 +127,20 @@ impl FileContents for VecFileContents {
}
}
struct VecFileContents {
pub struct VecFileContents {
content: Vec<u8>,
}
impl VecFileContents {
fn new() -> Self {
pub fn new() -> Self {
Self {
content: Vec::new(),
}
}
pub fn with_content(content: Vec<u8>) -> Self {
Self { content }
}
}
/// An `InMemoryFile` is a shared handle to some underlying data. The relationship is analagous to