diff options
Diffstat (limited to 'crates/shirabe/src/util')
| -rw-r--r-- | crates/shirabe/src/util/http/curl_response.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/shirabe/src/util/http/curl_response.rs b/crates/shirabe/src/util/http/curl_response.rs index 81af5af..97b9a4a 100644 --- a/crates/shirabe/src/util/http/curl_response.rs +++ b/crates/shirabe/src/util/http/curl_response.rs @@ -1 +1,31 @@ //! ref: composer/src/Composer/Util/Http/CurlResponse.php + +use indexmap::IndexMap; +use shirabe_php_shim::PhpMixed; + +use super::response::Response; + +#[derive(Debug)] +pub struct CurlResponse { + inner: Response, + curl_info: IndexMap<String, PhpMixed>, +} + +impl CurlResponse { + pub fn new( + request: IndexMap<String, PhpMixed>, + code: Option<i64>, + headers: Vec<String>, + body: Option<String>, + curl_info: IndexMap<String, PhpMixed>, + ) -> Self { + Self { + inner: Response::new(request, code, headers, body), + curl_info, + } + } + + pub fn get_curl_info(&self) -> &IndexMap<String, PhpMixed> { + &self.curl_info + } +} |
