mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make Response::new() an inherent method.
There is no real reason to put this in an extension trait.
This commit is contained in:
parent
5fbed88248
commit
8b629652ac
5 changed files with 16 additions and 39 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue