Support for extension methods, getResponseHeader(), and an extra error

This commit is contained in:
Manish Goregaokar 2014-06-07 23:05:59 +05:30
parent 1184b500e5
commit e8de5f2f55
6 changed files with 51 additions and 27 deletions

View file

@ -2,7 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::from_str::FromStr;
use std::hash::{Hash, sip};
use std::path::BytesContainer;
use std::str;
#[deriving(Encodable,Clone,TotalEq,Eq)]
@ -113,4 +115,10 @@ impl Hash for ByteString {
let ByteString(ref vec) = *self;
vec.hash(state);
}
}
impl FromStr for ByteString {
fn from_str(s: &str) -> Option<ByteString> {
Some(ByteString::new(s.container_into_owned_bytes()))
}
}