Struct script::dom::xmlhttprequest::XMLHttpRequest
source · #[repr(C)]pub struct XMLHttpRequest {Show 32 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: Heap<*mut JSObject>,
response_json: Heap<JSVal>,
response_headers: DomRefCell<HeaderMap>,
override_mime_type: DomRefCell<Option<Mime>>,
override_charset: DomRefCell<Option<&'static Encoding>>,
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: Heap<*mut JSObject>
§response_json: Heap<JSVal>
§response_headers: DomRefCell<HeaderMap>
§override_mime_type: DomRefCell<Option<Mime>>
§override_charset: DomRefCell<Option<&'static Encoding>>
§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>>
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)
fn text_response(&self) -> String
fn blob_response(&self) -> Root<Dom<Blob>>
fn arraybuffer_response(&self, cx: JSContext) -> Option<NonNull<JSObject>>
fn document_response(&self) -> Option<Root<Dom<Document>>>
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>
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::XMLHttpRequestBinding::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::XMLHttpRequestBinding::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<XMLHttpRequest> for XMLHttpRequest
impl PartialEq<XMLHttpRequest> 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
fn GetOnreadystatechange(&self) -> Option<Rc<EventHandlerNonNull>>
fn SetOnreadystatechange(&self, listener: Option<Rc<EventHandlerNonNull>>)
fn ReadyState(&self) -> u16
fn Open(&self, method: ByteString, url: USVString) -> Result<(), Error>
fn Open_(
&self,
method: ByteString,
url: USVString,
asynch: bool,
username: Option<USVString>,
password: Option<USVString>
) -> Result<(), Error>
fn SetRequestHeader(
&self,
name: ByteString,
value: ByteString
) -> Result<(), Error>
fn Timeout(&self) -> u32
fn SetTimeout(&self, timeout: u32) -> Result<(), Error>
fn WithCredentials(&self) -> bool
fn SetWithCredentials(&self, with_credentials: bool) -> Result<(), Error>
fn Upload(&self) -> Root<Dom<XMLHttpRequestUpload>>
fn Send(
&self,
data: Option<DocumentOrXMLHttpRequestBodyInit>
) -> Result<(), Error>
fn Abort(&self)
fn ResponseURL(&self) -> USVString
fn Status(&self) -> u16
fn StatusText(&self) -> ByteString
fn GetResponseHeader(&self, name: ByteString) -> Option<ByteString>
fn GetAllResponseHeaders(&self) -> ByteString
fn OverrideMimeType(&self, mime: DOMString) -> Result<(), Error>
fn ResponseType(&self) -> XMLHttpRequestResponseType
fn SetResponseType(
&self,
response_type: XMLHttpRequestResponseType
) -> Result<(), Error>
fn Response(&self, cx: JSContext) -> JSVal
fn GetResponseText(&self) -> Result<USVString, Error>
fn GetResponseXML(&self) -> Result<Option<Root<Dom<Document>>>, Error>
impl DerivedFrom<EventTarget> for XMLHttpRequest
impl DerivedFrom<XMLHttpRequestEventTarget> for XMLHttpRequest
Auto Trait Implementations§
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> 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