#[repr(C)]pub struct Response {
reflector_: Reflector,
headers_reflector: MutNullableDom<Headers>,
status: DomRefCell<HttpStatus>,
response_type: DomRefCell<ResponseType>,
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<HttpStatus>
§response_type: DomRefCell<ResponseType>
§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, can_gc: CanGc) -> Response
pub fn new(global: &GlobalScope, can_gc: CanGc) -> Root<Dom<Response>>
fn new_with_proto( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Root<Dom<Response>>
pub fn error_stream(&self, error: Error)
source§impl Response
impl Response
pub fn set_type(&self, new_response_type: DOMResponseType, can_gc: CanGc)
pub fn set_headers( &self, option_hyper_headers: Option<Serde<HyperHeaders>>, can_gc: CanGc, )
pub fn set_status(&self, status: &HttpStatus)
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, can_gc: CanGc, )
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 BodyMixin for Response
impl BodyMixin for Response
source§impl DomObjectWrap for Response
impl DomObjectWrap for Response
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ResponseBinding::Response_Binding::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>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::response::Response>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::ResponseBinding::Response_Binding::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>, script_runtime::CanGc) -> 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§impl ResponseMethods<DomTypeHolder> for Response
impl ResponseMethods<DomTypeHolder> for Response
fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, body: Option<BodyInit>, init: &ResponseInit, ) -> Result<Root<Dom<Response>>, Error>
fn Error(global: &GlobalScope, can_gc: CanGc) -> Root<Dom<Response>>
fn Redirect( global: &GlobalScope, url: USVString, status: u16, can_gc: CanGc, ) -> Result<Root<Dom<Response>>, Error>
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, can_gc: CanGc) -> Root<Dom<Headers>>
fn Clone(&self, can_gc: CanGc) -> Result<Root<Dom<Response>>, Error>
fn BodyUsed(&self) -> bool
fn Text(&self, can_gc: CanGc) -> Rc<Promise>
fn Blob(&self, can_gc: CanGc) -> Rc<Promise>
fn FormData(&self, can_gc: CanGc) -> Rc<Promise>
fn Json(&self, can_gc: CanGc) -> Rc<Promise>
fn ArrayBuffer(&self, can_gc: CanGc) -> Rc<Promise>
source§impl ToJSValConvertible for Response
impl ToJSValConvertible for Response
impl Eq for Response
Auto Trait Implementations§
impl !Freeze for Response
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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