Track what needs to be done in-source

This commit is contained in:
Lucien Greathouse 2018-05-26 03:15:39 -07:00
parent 63ea182f94
commit bf6766919e
8 changed files with 15 additions and 4 deletions

View file

@ -2,6 +2,8 @@ use std::path::{Path, PathBuf, Component};
use partition::Partition;
// TODO: Change backing data structure to use a single allocation with slices
// taken out of it for each portion
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct FileRoute {
pub partition: String,

View file

@ -9,9 +9,6 @@ pub enum Message {
InstanceChanged {
id: Id,
},
Error {
message: String
},
}
#[derive(Clone)]

View file

@ -9,6 +9,8 @@ use session::SessionConfig;
use vfs_session::{VfsSession, FileItem, FileChange};
use message_session::{Message, MessageSession};
// TODO: Rethink data structure and insertion/update behavior. Maybe break some
// pieces off into a new object?
fn file_to_instances(
file_item: &FileItem,
partition: &Partition,
@ -81,6 +83,8 @@ fn file_to_instances(
output.get_mut(&child_id).unwrap().parent = Some(primary_id);
changed_ids.push(child_id);
// TODO: Should I stop using drain on Vecs of Copyable types?
for id in child_changed_ids.drain(..) {
changed_ids.push(id);
}
@ -99,6 +103,7 @@ pub struct RbxSession {
message_session: MessageSession,
/// The RbxInstance that represents each partition.
// TODO: Can this be removed in favor of instances_by_route?
partition_instances: HashMap<String, Id>,
/// The store of all instances in the session.
@ -153,6 +158,7 @@ impl RbxSession {
self.message_session.push_messages(&messages);
},
FileChange::Deleted(route) => {
// TODO: Handle deletion of children here and in Moved case.
match self.instances_by_route.get(route) {
Some(id) => {
self.instances.remove(id);

View file

@ -128,6 +128,8 @@ pub fn start(config: WebConfig) {
})
},
// TODO: API to read only specific instances
_ => rouille::Response::empty_404()
)
});