Struct script::dom::xmlhttprequest::XMLHttpRequest
source · #[repr(C)]pub struct XMLHttpRequest {Show 30 fields
eventtarget: XMLHttpRequestEventTarget,
ready_state: Cell<XMLHttpRequestState>,
timeout: Cell<Duration>,
with_credentials: Cell<bool>,
upload: Dom<XMLHttpRequestUpload>,
response_url: DomRefCell<String>,
status: DomRefCell<HttpStatus>,
response: DomRefCell<Vec<u8>>,
response_type: Cell<XMLHttpRequestResponseType>,
response_xml: MutNullableDom<Document>,
response_blob: MutNullableDom<Blob>,
response_arraybuffer: HeapBufferSource<ArrayBufferU8>,
response_json: Heap<JSVal>,
response_headers: DomRefCell<HeaderMap>,
override_mime_type: DomRefCell<Option<Mime>>,
request_method: DomRefCell<Method>,
request_url: DomRefCell<Option<ServoUrl>>,
request_headers: DomRefCell<HeaderMap>,
request_body_len: Cell<usize>,
sync: Cell<bool>,
upload_complete: Cell<bool>,
upload_listener: Cell<bool>,
send_flag: Cell<bool>,
timeout_cancel: DomRefCell<Option<OneshotTimerHandle>>,
fetch_time: Cell<Instant>,
generation_id: Cell<GenerationId>,
response_status: Cell<Result<(), ()>>,
referrer: Referrer,
referrer_policy: ReferrerPolicy,
canceller: DomRefCell<FetchCanceller>,
}
Fields§
§eventtarget: XMLHttpRequestEventTarget
§ready_state: Cell<XMLHttpRequestState>
§timeout: Cell<Duration>
§with_credentials: Cell<bool>
§upload: Dom<XMLHttpRequestUpload>
§response_url: DomRefCell<String>
§status: DomRefCell<HttpStatus>
§response: DomRefCell<Vec<u8>>
§response_type: Cell<XMLHttpRequestResponseType>
§response_xml: MutNullableDom<Document>
§response_blob: MutNullableDom<Blob>
§response_arraybuffer: HeapBufferSource<ArrayBufferU8>
§response_json: Heap<JSVal>
§response_headers: DomRefCell<HeaderMap>
§override_mime_type: DomRefCell<Option<Mime>>
§request_method: DomRefCell<Method>
§request_url: DomRefCell<Option<ServoUrl>>
§request_headers: DomRefCell<HeaderMap>
§request_body_len: Cell<usize>
§sync: Cell<bool>
§upload_complete: Cell<bool>
§upload_listener: Cell<bool>
§send_flag: Cell<bool>
§timeout_cancel: DomRefCell<Option<OneshotTimerHandle>>
§fetch_time: Cell<Instant>
§generation_id: Cell<GenerationId>
§response_status: Cell<Result<(), ()>>
§referrer: Referrer
§referrer_policy: ReferrerPolicy
§canceller: DomRefCell<FetchCanceller>
Implementations§
source§impl XMLHttpRequest
impl XMLHttpRequest
fn __assert_parent_type(&self)
source§impl XMLHttpRequest
impl XMLHttpRequest
fn new_inherited(global: &GlobalScope) -> XMLHttpRequest
fn new( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Root<Dom<XMLHttpRequest>>
fn sync_in_window(&self) -> bool
fn initiate_async_xhr( context: Arc<Mutex<XHRContext>>, task_source: NetworkingTaskSource, global: &GlobalScope, init: RequestBuilder, cancellation_chan: IpcReceiver<()>, )
source§impl XMLHttpRequest
impl XMLHttpRequest
fn change_ready_state(&self, rs: XMLHttpRequestState, can_gc: CanGc)
fn process_headers_available( &self, gen_id: GenerationId, metadata: Result<FetchMetadata, NetworkError>, can_gc: CanGc, ) -> Result<(), Error>
fn process_data_available( &self, gen_id: GenerationId, payload: Vec<u8>, can_gc: CanGc, )
fn process_response_complete( &self, gen_id: GenerationId, status: Result<(), NetworkError>, can_gc: CanGc, ) -> Result<(), Error>
fn process_partial_response(&self, progress: XHRProgress, can_gc: CanGc)
fn terminate_ongoing_fetch(&self)
fn dispatch_progress_event( &self, upload: bool, type_: Atom, loaded: u64, total: Option<u64>, can_gc: CanGc, )
fn dispatch_upload_progress_event( &self, type_: Atom, partial_load: Result<Option<u64>, ()>, can_gc: CanGc, )
fn dispatch_response_progress_event(&self, type_: Atom, can_gc: CanGc)
fn set_timeout(&self, duration: Duration)
fn cancel_timeout(&self)
sourcefn arraybuffer_response(&self, cx: JSContext) -> Option<ArrayBuffer>
fn arraybuffer_response(&self, cx: JSContext) -> Option<ArrayBuffer>
sourcefn json_response(&self, cx: JSContext, rval: MutableHandleValue<'_>)
fn json_response(&self, cx: JSContext, rval: MutableHandleValue<'_>)
fn document_text_html(&self, can_gc: CanGc) -> Root<Dom<Document>>
fn handle_xml(&self, can_gc: CanGc) -> Root<Dom<Document>>
fn new_doc( &self, is_html_document: IsHTMLDocument, can_gc: CanGc, ) -> Root<Dom<Document>>
fn filter_response_headers(&self) -> HeaderMap
fn discard_subsequent_responses(&self)
fn fetch(&self, init: RequestBuilder, global: &GlobalScope) -> Result<(), Error>
sourcefn final_charset(&self) -> Option<&'static Encoding>
fn final_charset(&self) -> Option<&'static Encoding>
Trait Implementations§
source§impl Castable for XMLHttpRequest
impl Castable for XMLHttpRequest
source§impl DomObject for XMLHttpRequest
impl DomObject for XMLHttpRequest
source§impl DomObjectWrap for XMLHttpRequest
impl DomObjectWrap for XMLHttpRequest
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequest_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::xmlhttprequest::XMLHttpRequest>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xmlhttprequest::XMLHttpRequest>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::XMLHttpRequestBinding::XMLHttpRequest_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::xmlhttprequest::XMLHttpRequest>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xmlhttprequest::XMLHttpRequest>>}
Function pointer to the general wrap function type
source§impl HasParent for XMLHttpRequest
impl HasParent for XMLHttpRequest
source§fn as_parent(&self) -> &XMLHttpRequestEventTarget
fn as_parent(&self) -> &XMLHttpRequestEventTarget
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = XMLHttpRequestEventTarget
source§impl IDLInterface for XMLHttpRequest
impl IDLInterface for XMLHttpRequest
source§impl MallocSizeOf for XMLHttpRequest
impl MallocSizeOf for XMLHttpRequest
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 XMLHttpRequest
impl MutDomObject for XMLHttpRequest
source§impl PartialEq for XMLHttpRequest
impl PartialEq for XMLHttpRequest
source§impl ToJSValConvertible for XMLHttpRequest
impl ToJSValConvertible for XMLHttpRequest
source§impl Traceable for XMLHttpRequest
impl Traceable for XMLHttpRequest
source§impl XMLHttpRequestMethods for XMLHttpRequest
impl XMLHttpRequestMethods for XMLHttpRequest
source§fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
) -> Result<Root<Dom<XMLHttpRequest>>, Error>
fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Result<Root<Dom<XMLHttpRequest>>, Error>
source§fn Open_(
&self,
method: ByteString,
url: USVString,
asynch: bool,
username: Option<USVString>,
password: Option<USVString>,
) -> Result<(), Error>
fn Open_( &self, method: ByteString, url: USVString, asynch: bool, username: Option<USVString>, password: Option<USVString>, ) -> Result<(), Error>
source§fn SetRequestHeader(
&self,
name: ByteString,
value: ByteString,
) -> Result<(), Error>
fn SetRequestHeader( &self, name: ByteString, value: ByteString, ) -> Result<(), Error>
source§fn Send(
&self,
data: Option<DocumentOrXMLHttpRequestBodyInit>,
can_gc: CanGc,
) -> Result<(), Error>
fn Send( &self, data: Option<DocumentOrXMLHttpRequestBodyInit>, can_gc: CanGc, ) -> Result<(), Error>
source§fn GetResponseHeader(&self, name: ByteString) -> Option<ByteString>
fn GetResponseHeader(&self, name: ByteString) -> Option<ByteString>
source§fn GetAllResponseHeaders(&self) -> ByteString
fn GetAllResponseHeaders(&self) -> ByteString
source§fn ResponseType(&self) -> XMLHttpRequestResponseType
fn ResponseType(&self) -> XMLHttpRequestResponseType
source§fn SetResponseType(
&self,
response_type: XMLHttpRequestResponseType,
) -> Result<(), Error>
fn SetResponseType( &self, response_type: XMLHttpRequestResponseType, ) -> Result<(), Error>
fn GetOnreadystatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnreadystatechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
impl DerivedFrom<EventTarget> for XMLHttpRequest
impl DerivedFrom<XMLHttpRequestEventTarget> for XMLHttpRequest
impl Eq for XMLHttpRequest
Auto Trait Implementations§
impl !Freeze for XMLHttpRequest
impl !RefUnwindSafe for XMLHttpRequest
impl !Send for XMLHttpRequest
impl !Sync for XMLHttpRequest
impl Unpin for XMLHttpRequest
impl !UnwindSafe for XMLHttpRequest
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