list warrens + explore nested folders
This commit is contained in:
24
backend/src/fs/mod.rs
Normal file
24
backend/src/fs/mod.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
mod dir;
|
||||
pub use dir::*;
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum FileType {
|
||||
File,
|
||||
Directory,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DirectoryEntry {
|
||||
name: String,
|
||||
file_type: FileType,
|
||||
}
|
||||
|
||||
impl DirectoryEntry {
|
||||
pub fn new(name: String, file_type: FileType) -> Self {
|
||||
Self { name, file_type }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user