Clean up warnings, add RojoTree into ServeSession

This commit is contained in:
Lucien Greathouse
2019-09-09 15:17:03 -07:00
parent 3e759b3e8e
commit bb6ab74c19
9 changed files with 23 additions and 21 deletions

View File

@@ -1,23 +1,29 @@
use std::collections::HashSet;
use crate::{project::Project, session_id::SessionId};
use crate::{project::Project, session_id::SessionId, snapshot::RojoTree};
/// Contains all of the state for a Rojo serve session.
pub struct ServeSession {
root_project: Option<Project>,
session_id: SessionId,
tree: RojoTree,
}
impl ServeSession {
pub fn new(root_project: Option<Project>) -> ServeSession {
pub fn new(tree: RojoTree, root_project: Option<Project>) -> ServeSession {
let session_id = SessionId::new();
ServeSession {
session_id,
root_project,
tree,
}
}
pub fn tree(&self) -> &RojoTree {
&self.tree
}
pub fn session_id(&self) -> SessionId {
self.session_id
}