Make Response::new() an inherent method.

There is no real reason to put this in an extension trait.
This commit is contained in:
Ms2ger 2016-03-08 17:37:50 +01:00
parent 5fbed88248
commit 8b629652ac
5 changed files with 16 additions and 39 deletions

View file

@ -93,6 +93,22 @@ pub struct Response {
}
impl Response {
pub fn new() -> Response {
Response {
response_type: ResponseType::Default,
termination_reason: None,
url: None,
url_list: RefCell::new(Vec::new()),
status: Some(StatusCode::Ok),
headers: Headers::new(),
body: Arc::new(Mutex::new(ResponseBody::Empty)),
cache_state: CacheState::None,
https_state: HttpsState::None,
internal_response: None,
return_internal: Cell::new(true)
}
}
pub fn network_error() -> Response {
Response {
response_type: ResponseType::Error,