Struct xpcom::interfaces::nsIHttpResponse
[−]
[src]
#[repr(C)]pub struct nsIHttpResponse { /* fields omitted */ }
interface nsIHttpResponse : nsISupports
Methods
impl nsIHttpResponse
[src]
pub fn coerce<T: nsIHttpResponseCoerce>(&self) -> &T
[src]
Cast this nsIHttpResponse
to one of its base interfaces.
impl nsIHttpResponse
[src]
pub unsafe fn SetStatusLine(
&self,
httpVersion: *const c_char,
statusCode: uint16_t,
description: *const c_char
) -> nsresult
[src]
&self,
httpVersion: *const c_char,
statusCode: uint16_t,
description: *const c_char
) -> nsresult
/**
* Represents an HTTP response, as described in RFC 2616, section 6.
*/
/**
* Sets the status line for this. If this method is never called on this, the
* status line defaults to "HTTP/", followed by the server's default HTTP
* version (e.g. "1.1"), followed by " 200 OK".
*
* @param httpVersion
* the HTTP version of this, as a string (e.g. "1.1"); if null, the server
* default is used
* @param code
* the numeric HTTP status code for this
* @param description
* a human-readable description of code; may be null if no description is
* desired
* @throws NS_ERROR_INVALID_ARG
* if httpVersion is not a valid HTTP version string, statusCode is greater
* than 999, or description contains invalid characters
* @throws NS_ERROR_NOT_AVAILABLE
* if this response is being processed asynchronously and data has been
* written to this response's body, or if seizePower() has been called on
* this
*/
void setStatusLine (in string httpVersion, in unsigned short statusCode, in string description);
pub unsafe fn SetHeader(
&self,
name: *const c_char,
value: *const c_char,
merge: bool
) -> nsresult
[src]
&self,
name: *const c_char,
value: *const c_char,
merge: bool
) -> nsresult
/**
* Sets the specified header in this.
*
* @param name
* the name of the header; must match the field-name production per RFC 2616
* @param value
* the value of the header; must match the field-value production per RFC
* 2616
* @param merge
* when true, if the given header already exists in this, the values passed
* to this function will be merged into the existing header, per RFC 2616
* header semantics (except for the Set-Cookie, WWW-Authenticate, and
* Proxy-Authenticate headers, which will treat each such merged header as
* an additional instance of the header, for real-world compatibility
* reasons); when false, replaces any existing header of the given name (if
* any exists) with a new header with the specified value
* @throws NS_ERROR_INVALID_ARG
* if name or value is not a valid header component
* @throws NS_ERROR_NOT_AVAILABLE
* if this response is being processed asynchronously and data has been
* written to this response's body, or if seizePower() has been called on
* this
*/
void setHeader (in string name, in string value, in boolean merge);
pub unsafe fn SetHeaderNoCheck(
&self,
name: *const c_char,
value: *const c_char
) -> nsresult
[src]
&self,
name: *const c_char,
value: *const c_char
) -> nsresult
/**
* This is used for testing our header handling, so header will be sent out
* without transformation. There can be multiple headers.
*/
void setHeaderNoCheck (in string name, in string value);
pub unsafe fn GetBodyOutputStream(
&self,
aBodyOutputStream: *mut *const nsIOutputStream
) -> nsresult
[src]
&self,
aBodyOutputStream: *mut *const nsIOutputStream
) -> nsresult
/**
* A stream to which data appearing in the body of this response (or in the
* totality of the response if seizePower() is called) should be written.
* After this response has been designated as being processed asynchronously,
* or after seizePower() has been called on this, subsequent writes will no
* longer be buffered and will be written to the underlying transport without
* delaying until the entire response is constructed. Write-through may or
* may not be synchronous in the implementation, and in any case particular
* behavior may not be observable to the HTTP client as intermediate buffers
* both in the server socket and in the client may delay written data; be
* prepared for delays at any time.
*
* @throws NS_ERROR_NOT_AVAILABLE
* if accessed after this response is fully constructed
*/
readonly attribute nsIOutputStream bodyOutputStream;
pub unsafe fn Write(&self, data: *const c_char) -> nsresult
[src]
/**
* Writes a string to the response's output stream. This method is merely a
* convenient shorthand for writing the same data to bodyOutputStream
* directly.
*
* @note
* This method is only guaranteed to work with ASCII data.
* @throws NS_ERROR_NOT_AVAILABLE
* if called after this response has been fully constructed
*/
void write (in string data);
pub unsafe fn ProcessAsync(&self) -> nsresult
[src]
/**
* Signals that this response is being constructed asynchronously. Requests
* are typically completely constructed during nsIHttpRequestHandler.handle;
* however, responses which require significant resources (time, memory,
* processing) to construct can be created and sent incrementally by calling
* this method during the call to nsIHttpRequestHandler.handle. This method
* only has this effect when called during nsIHttpRequestHandler.handle;
* behavior is undefined if it is called at a later time. It may be called
* multiple times with no ill effect, so long as each call occurs before
* finish() is called.
*
* @throws NS_ERROR_UNEXPECTED
* if not initially called within a nsIHttpRequestHandler.handle call or if
* called after this response has been finished
* @throws NS_ERROR_NOT_AVAILABLE
* if seizePower() has been called on this
*/
void processAsync ();
pub unsafe fn SeizePower(&self) -> nsresult
[src]
/**
* Seizes complete control of this response (and its connection) from the
* server, allowing raw and unfettered access to data being sent in the HTTP
* response. Once this method has been called the only property which may be
* accessed without an exception being thrown is bodyOutputStream, and the
* only methods which may be accessed without an exception being thrown are
* write(), finish(), and seizePower() (which may be called multiple times
* without ill effect so long as all calls are otherwise allowed).
*
* After a successful call, all data subsequently written to the body of this
* response is written directly to the corresponding connection. (Previously-
* written data is silently discarded.) No status line or headers are sent
* before doing so; if the response handler wishes to write such data, it must
* do so manually. Data generation completes only when finish() is called; it
* is not enough to simply call close() on bodyOutputStream.
*
* @throws NS_ERROR_NOT_AVAILABLE
* if processAsync() has been called on this
* @throws NS_ERROR_UNEXPECTED
* if finish() has been called on this
*/
void seizePower ();
pub unsafe fn Finish(&self) -> nsresult
[src]
/**
* Signals that construction of this response is complete and that it may be
* sent over the network to the client, or if seizePower() has been called
* signals that all data has been written and that the underlying connection
* may be closed. This method may only be called after processAsync() or
* seizePower() has been called. This method is idempotent.
*
* @throws NS_ERROR_UNEXPECTED
* if processAsync() or seizePower() has not already been properly called
*/
void finish ();
Methods from Deref<Target = nsISupports>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsIHttpResponse
[src]
const IID: nsIID
IID: nsIID = nsID(449648322, 56409, 17146, [145, 96, 79, 38, 196, 60, 28, 33])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[src]
Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more
impl RefCounted for nsIHttpResponse
[src]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsIHttpResponse
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.