#[repr(C)]pub struct Response {
reflector_: Reflector,
headers_reflector: MutNullableDom<Headers>,
status: DomRefCell<Option<StatusCode>>,
raw_status: DomRefCell<Option<(u16, Vec<u8>)>>,
response_type: DomRefCell<DOMResponseType>,
url: DomRefCell<Option<ServoUrl>>,
url_list: DomRefCell<Vec<ServoUrl>>,
body_stream: MutNullableDom<ReadableStream>,
stream_consumer: DomRefCell<Option<StreamConsumer>>,
redirected: DomRefCell<bool>,
}
Fields§
§reflector_: Reflector
§headers_reflector: MutNullableDom<Headers>
§status: DomRefCell<Option<StatusCode>>
None
can be considered a StatusCode of 0
.
raw_status: DomRefCell<Option<(u16, Vec<u8>)>>
§response_type: DomRefCell<DOMResponseType>
§url: DomRefCell<Option<ServoUrl>>
§url_list: DomRefCell<Vec<ServoUrl>>
§body_stream: MutNullableDom<ReadableStream>
The stream of https://fetch.spec.whatwg.org/#body.
stream_consumer: DomRefCell<Option<StreamConsumer>>
§redirected: DomRefCell<bool>
Implementations§
source§impl Response
impl Response
fn __assert_parent_type(&self)
source§impl Response
impl Response
pub fn new_inherited(global: &GlobalScope) -> Response
pub fn new(global: &GlobalScope) -> Root<Dom<Response>>
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject<'_>>
) -> Root<Dom<Response>>
pub fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
body: Option<BodyInit>,
init: &ResponseInit
) -> Result<Root<Dom<Response>>, Error>
pub fn Error(global: &GlobalScope) -> Root<Dom<Response>>
pub fn Redirect(
global: &GlobalScope,
url: USVString,
status: u16
) -> Result<Root<Dom<Response>>, Error>
pub fn error_stream(&self, error: Error)
source§impl Response
impl Response
pub fn set_type(&self, new_response_type: DOMResponseType)
pub fn set_headers(&self, option_hyper_headers: Option<Serde<HyperHeaders>>)
pub fn set_raw_status(&self, status: Option<(u16, Vec<u8>)>)
pub fn set_final_url(&self, final_url: ServoUrl)
pub fn set_redirected(&self, is_redirected: bool)
fn set_response_members_by_type(&self, response_type: DOMResponseType)
pub fn set_stream_consumer(&self, sc: Option<StreamConsumer>)
pub fn stream_chunk(&self, chunk: Vec<u8>)
pub fn finish(&self)
Trait Implementations§
source§impl DomObjectWrap for Response
impl DomObjectWrap for Response
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ResponseBinding::ResponseBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::response::Response>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::response::Response>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ResponseBinding::ResponseBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::response::Response>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::response::Response>>}
Function pointer to the general wrap function type
source§impl IDLInterface for Response
impl IDLInterface for Response
source§impl MallocSizeOf for Response
impl MallocSizeOf for Response
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for Response
impl MutDomObject for Response
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<Response> for Response
impl PartialEq<Response> for Response
source§impl ResponseMethods for Response
impl ResponseMethods for Response
fn Type(&self) -> DOMResponseType
fn Url(&self) -> USVString
fn Redirected(&self) -> bool
fn Status(&self) -> u16
fn Ok(&self) -> bool
fn StatusText(&self) -> ByteString
fn Headers(&self) -> Root<Dom<Headers>>
fn Clone(&self) -> Result<Root<Dom<Response>>, Error>
fn BodyUsed(&self) -> bool
fn Text(&self) -> Rc<Promise>
fn Blob(&self) -> Rc<Promise>
fn FormData(&self) -> Rc<Promise>
fn Json(&self) -> Rc<Promise>
fn ArrayBuffer(&self) -> Rc<Promise>
source§impl ToJSValConvertible for Response
impl ToJSValConvertible for Response
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl !Send for Response
impl !Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert