mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-23 14:15:24 +00:00
Move Rojo server into root of the repository
This commit is contained in:
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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user