mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19.
This commit is contained in:
parent
cf616b90a2
commit
16c7060bc8
153 changed files with 2095 additions and 1298 deletions
|
@ -5,12 +5,13 @@
|
|||
/// Low-level wire protocol implementation. Currently only supports [JSON packets](https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport#JSON_Packets).
|
||||
|
||||
use serialize::{json, Encodable};
|
||||
use serialize::json::Json;
|
||||
use std::io::{IoError, OtherIoError, EndOfFile, TcpStream, IoResult};
|
||||
use std::num;
|
||||
|
||||
pub trait JsonPacketStream {
|
||||
fn write_json_packet<'a, T: Encodable<json::Encoder<'a>,IoError>>(&mut self, obj: &T);
|
||||
fn read_json_packet(&mut self) -> IoResult<json::Json>;
|
||||
fn read_json_packet(&mut self) -> IoResult<Json>;
|
||||
}
|
||||
|
||||
impl JsonPacketStream for TcpStream {
|
||||
|
@ -22,7 +23,7 @@ impl JsonPacketStream for TcpStream {
|
|||
self.write_str(s.as_slice()).unwrap();
|
||||
}
|
||||
|
||||
fn read_json_packet<'a>(&mut self) -> IoResult<json::Json> {
|
||||
fn read_json_packet<'a>(&mut self) -> IoResult<Json> {
|
||||
// https://wiki.mozilla.org/Remote_Debugging_Protocol_Stream_Transport
|
||||
// In short, each JSON packet is [ascii length]:[JSON data of given length]
|
||||
let mut buffer = vec!();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue