Major Subsystem Rewrite (Reconciler Mk5) (#217)

This commit is contained in:
Lucien Greathouse 2019-08-27 15:00:37 -07:00 • committed by GitHub
parent 8e8291a0bd
commit fea303ac8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
80 changed files with 3843 additions and 5609 deletions

View file

@ -0,0 +1,33 @@
use std::collections::HashSet;
use crate::{
project::Project,
session_id::SessionId,
};
/// Contains all of the state for a Rojo serve session.
pub struct ServeSession {
root_project: Option<Project>,
session_id: SessionId,
}
impl ServeSession {
pub fn new(root_project: Option<Project>) -> ServeSession {
let session_id = SessionId::new();
ServeSession {
session_id,
root_project,
}
}
pub fn session_id(&self) -> SessionId {
self.session_id
}
pub fn serve_place_ids(&self) -> Option<&HashSet<u64>> {
self.root_project
.as_ref()
.and_then(|project| project.serve_place_ids.as_ref())
}
}