From dbdfa9cd37e85ee09bf31e99d17a5262ab1d4899 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 28 Jul 2012 17:08:33 -0700 Subject: [PATCH] servo: Add more resource_task docs Source-Repo: https://github.com/servo/servo Source-Revision: f2c97474c5e2acdf52e6dff1d56d1867efb6f050 --- servo/src/servo/resource/resource_task.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/servo/src/servo/resource/resource_task.rs b/servo/src/servo/resource/resource_task.rs index a5684436fc69..b9cb8ae0dc83 100644 --- a/servo/src/servo/resource/resource_task.rs +++ b/servo/src/servo/resource/resource_task.rs @@ -15,19 +15,31 @@ import std::net::url::url; import result::{result, ok, err}; enum ControlMsg { + /// Request the data associated with a particular URL Load(url, chan), Exit } +/// Messages sent in response to a `Load` message enum ProgressMsg { + /// Binary data - there may be multiple of these Payload(~[u8]), + /// Indicates loading is complete, either successfully or not Done(result<(), ()>) } +/// Handle to a resource task type ResourceTask = chan; -/// Creates a task to load a specific resource + +/** +Creates a task to load a specific resource + +The ResourceManager delegates loading to a different type of loader task for +each URL scheme +*/ type LoaderTaskFactory = fn~(url: url, chan); +/// Create a ResourceTask with the default loaders fn ResourceTask() -> ResourceTask { let loaders = ~[ (~"file", file_loader::factory),