mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 20:21:38 +00:00
Move Rojo server into root of the repository
This commit is contained in:
parent
ec9afba029
commit
6f7dbe99fe
48 changed files with 50 additions and 54 deletions
|
|
@ -1,33 +0,0 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ImfsSnapshot {
|
||||
File(FileSnapshot),
|
||||
Directory(DirectorySnapshot),
|
||||
}
|
||||
|
||||
impl ImfsSnapshot {
|
||||
/// Create a new file ImfsSnapshot with the given contents.
|
||||
pub fn file(contents: impl Into<Vec<u8>>) -> ImfsSnapshot {
|
||||
ImfsSnapshot::File(FileSnapshot {
|
||||
contents: contents.into(),
|
||||
})
|
||||
}
|
||||
|
||||
/// Create a new directory ImfsSnapshot with the given children.
|
||||
pub fn dir<S: Into<String>>(children: HashMap<S, ImfsSnapshot>) -> ImfsSnapshot {
|
||||
let children = children.into_iter().map(|(k, v)| (k.into(), v)).collect();
|
||||
|
||||
ImfsSnapshot::Directory(DirectorySnapshot { children })
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FileSnapshot {
|
||||
pub contents: Vec<u8>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct DirectorySnapshot {
|
||||
pub children: HashMap<String, ImfsSnapshot>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue