pub trait ResponseMethods<D>where
D: DomTypes,{
Show 21 methods
// Required methods
fn Error(
cx: &mut JSContext,
global: &<D as DomTypes>::GlobalScope,
) -> Root<Dom<<D as DomTypes>::Response>>;
fn Redirect(
cx: &mut JSContext,
global: &<D as DomTypes>::GlobalScope,
url: USVString,
status: u16,
) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>;
fn CreateFromJson(
cx: &mut JSContext,
global: &<D as DomTypes>::GlobalScope,
data: Handle<'_, Value>,
init: &ResponseInit,
) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>;
fn Type(&self) -> ResponseType;
fn Url(&self) -> USVString;
fn Redirected(&self) -> bool;
fn Status(&self) -> u16;
fn Ok(&self) -> bool;
fn StatusText(&self) -> ByteString;
fn Headers(&self, cx: &mut JSContext) -> Root<Dom<<D as DomTypes>::Headers>>;
fn Clone(
&self,
cx: &mut JSContext,
) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>;
fn BodyUsed(&self) -> bool;
fn GetBody(&self) -> Option<Root<Dom<<D as DomTypes>::ReadableStream>>>;
fn ArrayBuffer(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn Blob(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn Bytes(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn FormData(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn Json(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn Text(
&self,
cx: &mut JSContext,
) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot;
fn TextStream(
&self,
cx: &mut JSContext,
) -> Result<Root<Dom<<D as DomTypes>::ReadableStream>>, Error>;
fn Constructor(
cx: &mut JSContext,
global: &<D as DomTypes>::GlobalScope,
proto: Option<Handle<'_, *mut JSObject>>,
body: Option<ReadableStreamOrBlobOrArrayBufferViewOrArrayBufferOrFormDataOrStringOrURLSearchParams<D>>,
init: &ResponseInit,
) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>;
}Required Methods§
fn Error( cx: &mut JSContext, global: &<D as DomTypes>::GlobalScope, ) -> Root<Dom<<D as DomTypes>::Response>>
fn Redirect( cx: &mut JSContext, global: &<D as DomTypes>::GlobalScope, url: USVString, status: u16, ) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>
fn CreateFromJson( cx: &mut JSContext, global: &<D as DomTypes>::GlobalScope, data: Handle<'_, Value>, init: &ResponseInit, ) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>
fn Type(&self) -> ResponseType
fn Url(&self) -> USVString
fn Redirected(&self) -> bool
fn Status(&self) -> u16
fn Ok(&self) -> bool
fn StatusText(&self) -> ByteString
fn Headers(&self, cx: &mut JSContext) -> Root<Dom<<D as DomTypes>::Headers>>
fn Clone( &self, cx: &mut JSContext, ) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>
fn BodyUsed(&self) -> bool
fn GetBody(&self) -> Option<Root<Dom<<D as DomTypes>::ReadableStream>>>
fn ArrayBuffer( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn Blob( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn Bytes( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn FormData( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn Json( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn Text( &self, cx: &mut JSContext, ) -> <<D as DomTypes>::Promise as PromiseHelpers<D>>::StackRoot
fn TextStream( &self, cx: &mut JSContext, ) -> Result<Root<Dom<<D as DomTypes>::ReadableStream>>, Error>
fn Constructor( cx: &mut JSContext, global: &<D as DomTypes>::GlobalScope, proto: Option<Handle<'_, *mut JSObject>>, body: Option<ReadableStreamOrBlobOrArrayBufferViewOrArrayBufferOrFormDataOrStringOrURLSearchParams<D>>, init: &ResponseInit, ) -> Result<Root<Dom<<D as DomTypes>::Response>>, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.