Struct script::dom::xmlhttprequest::XMLHttpRequest
source · #[repr(C)]pub struct XMLHttpRequest {Show 31 fields
eventtarget: XMLHttpRequestEventTarget,
ready_state: Cell<XMLHttpRequestState>,
timeout: Cell<u32>,
with_credentials: Cell<bool>,
upload: Dom<XMLHttpRequestUpload>,
response_url: DomRefCell<String>,
status: Cell<u16>,
status_text: DomRefCell<ByteString>,
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<i64>,
generation_id: Cell<GenerationId>,
response_status: Cell<Result<(), ()>>,
referrer: Referrer,
referrer_policy: Option<ReferrerPolicy>,
canceller: DomRefCell<FetchCanceller>,
}
Fields§
§eventtarget: XMLHttpRequestEventTarget
§ready_state: Cell<XMLHttpRequestState>
§timeout: Cell<u32>
§with_credentials: Cell<bool>
§upload: Dom<XMLHttpRequestUpload>
§response_url: DomRefCell<String>
§status: Cell<u16>
§status_text: DomRefCell<ByteString>
§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<i64>
§generation_id: Cell<GenerationId>
§response_status: Cell<Result<(), ()>>
§referrer: Referrer
§referrer_policy: Option<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<'_>> ) -> Root<Dom<XMLHttpRequest>>
sourcepub fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>
) -> Result<Root<Dom<XMLHttpRequest>>, Error>
pub fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>> ) -> Result<Root<Dom<XMLHttpRequest>>, Error>
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)
fn process_headers_available( &self, gen_id: GenerationId, metadata: Result<FetchMetadata, NetworkError> ) -> Result<(), Error>
fn process_data_available(&self, gen_id: GenerationId, payload: Vec<u8>)
fn process_response_complete( &self, gen_id: GenerationId, status: Result<(), NetworkError> ) -> Result<(), Error>
fn process_partial_response(&self, progress: XHRProgress)
fn terminate_ongoing_fetch(&self)
fn dispatch_progress_event( &self, upload: bool, type_: Atom, loaded: u64, total: Option<u64> )
fn dispatch_upload_progress_event( &self, type_: Atom, partial_load: Result<Option<u64>, ()> )
fn dispatch_response_progress_event(&self, type_: Atom)
fn set_timeout(&self, duration_ms: u32)
fn cancel_timeout(&self)
sourcefn blob_response(&self) -> Root<Dom<Blob>>
fn blob_response(&self) -> Root<Dom<Blob>>
sourcefn arraybuffer_response(&self, cx: JSContext) -> Option<ArrayBuffer>
fn arraybuffer_response(&self, cx: JSContext) -> Option<ArrayBuffer>
sourcefn json_response(&self, cx: JSContext) -> JSVal
fn json_response(&self, cx: JSContext) -> JSVal
fn document_text_html(&self) -> Root<Dom<Document>>
fn handle_xml(&self) -> Root<Dom<Document>>
fn new_doc(&self, is_html_document: IsHTMLDocument) -> 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>) -> 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>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::xmlhttprequest::XMLHttpRequest>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> 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>) -> 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§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq for XMLHttpRequest
impl PartialEq for XMLHttpRequest
source§fn eq(&self, other: &XMLHttpRequest) -> bool
fn eq(&self, other: &XMLHttpRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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 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 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
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<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