mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 12:01: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
30
src/serve_session.rs
Normal file
30
src/serve_session.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
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())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue