servo: Start sketching a net module
authorBrian Anderson <banderson@mozilla.com>
Thu, 24 May 2012 14:36:25 -0700
changeset 470740 5ed3e6bf8a5df729000054870f9977ba0b510d48
parent 470739 33c990796ddc4394e0ec45523c1e910488973eca
child 470741 684ce28a63c27f06291c13f4895be05b1ff727dd
push id44079
push userbmo:gps@mozilla.com
push dateSat, 04 Feb 2017 00:14:49 +0000
servo: Start sketching a net module Source-Repo: https://github.com/servo/servo Source-Revision: b281a508e066b64577c3b8950210bfd8d9b7c37d
servo/src/servo/net.rs
servo/src/servo/net/uri.rs
servo/src/servo/servo.rc
new file mode 100644
--- /dev/null
+++ b/servo/src/servo/net.rs
@@ -0,0 +1,25 @@
+export uri, input_stream, channel, io_service, file_channel;
+
+import uri::uri;
+
+iface input_stream {
+    fn close();
+    fn read() -> [u8];
+}
+
+iface channel {
+    fn uri() -> uri;
+    fn open() -> input_stream;
+}
+
+iface io_service {
+    fn new_uri(spec: str) -> uri;
+    fn new_channel(uri: uri) -> channel;
+}
+
+class file_channel implements channel {
+    new() { }
+
+    fn uri() -> uri { fail }
+    fn open() -> input_stream { fail }
+}
new file mode 100644
--- /dev/null
+++ b/servo/src/servo/net/uri.rs
@@ -0,0 +1,13 @@
+export uri, build_uri;
+
+type uri = {
+    spec: str,
+    scheme: str,
+    host: option<str>,
+    port: option<uint>,
+    path: str
+};
+
+fn build_uri(_spec: str) -> uri {
+    fail
+}
--- a/servo/src/servo/servo.rc
+++ b/servo/src/servo/servo.rc
@@ -65,13 +65,17 @@ mod util {
 
 mod content {
     mod js;
     mod jsglobal;
     mod jsutil;
     mod name_pool;
 }
 
+mod net {
+    mod uri;
+}
+
 mod opts;
 mod engine;
 
 import servo_text = text;