Struct xpcom::interfaces::nsIMIMEInputStream [] [src]

#[repr(C)]
pub struct nsIMIMEInputStream { /* fields omitted */ }

interface nsIMIMEInputStream : nsIInputStream

/**
 * The MIME stream separates headers and a datastream. It also allows
 * automatic creation of the content-length header.
 */

Methods

impl nsIMIMEInputStream
[src]

[src]

Cast this nsIMIMEInputStream to one of its base interfaces.

impl nsIMIMEInputStream
[src]

[src]

/**
     * Adds an additional header to the stream on the form "name: value". May
     * not be called once the stream has been started to be read.
     * @param name   name of the header
     * @param value  value of the header
     */

void addHeader (in string name, in string value);

[src]

/**
     * Visits all headers which have been added via addHeader.  Calling
     * addHeader while visiting request headers has undefined behavior.
     *
     * @param aVisitor
     *        The header visitor instance.
     */

void visitHeaders (in nsIHttpHeaderVisitor visitor);

[src]

/**
     * Sets data-stream. May not be called once the stream has been started
     * to be read.
     * The cursor of the new stream should be located at the beginning of the
     * stream if the implementation of the nsIMIMEInputStream also is used as
     * an nsISeekableStream.
     * @param stream  stream containing the data for the stream
     */

void setData (in nsIInputStream stream);

[src]

/**
     * Get the wrapped data stream
     */

readonly attribute nsIInputStream data;

Methods from Deref<Target = nsIInputStream>

[src]

Cast this nsIInputStream to one of its base interfaces.

[src]

/**
 * nsIInputStream
 *
 * An interface describing a readable stream of data.  An input stream may be
 * "blocking" or "non-blocking" (see the IsNonBlocking method).  A blocking
 * input stream may suspend the calling thread in order to satisfy a call to
 * Close, Available, Read, or ReadSegments.  A non-blocking input stream, on
 * the other hand, must not block the calling thread of execution.
 *
 * NOTE: blocking input streams are often read on a background thread to avoid
 * locking up the main application thread.  For this reason, it is generally
 * the case that a blocking input stream should be implemented using thread-
 * safe AddRef and Release.
 */
/**
     * Close the stream.  This method causes subsequent calls to Read and
     * ReadSegments to return 0 bytes read to indicate end-of-file.  Any
     * subsequent calls to Available should throw NS_BASE_STREAM_CLOSED.
     */

void close ();

[src]

/**
     * Determine number of bytes available in the stream.  A non-blocking
     * stream that does not yet have any data to read should return 0 bytes
     * from this method (i.e., it must not throw the NS_BASE_STREAM_WOULD_BLOCK
     * exception).
     *
     * In addition to the number of bytes available in the stream, this method
     * also informs the caller of the current status of the stream.  A stream
     * that is closed will throw an exception when this method is called.  That
     * enables the caller to know the condition of the stream before attempting
     * to read from it.  If a stream is at end-of-file, but not closed, then
     * this method returns 0 bytes available.  (Note: some nsIInputStream
     * implementations automatically close when eof is reached; some do not).
     *
     * @return number of bytes currently available in the stream.
     *
     * @throws NS_BASE_STREAM_CLOSED if the stream is closed normally.
     * @throws <other-error> if the stream is closed due to some error
     *   condition
     */

unsigned long long available ();

[src]

/**
     * Read data from the stream.
     *
     * @param aBuf the buffer into which the data is to be read
     * @param aCount the maximum number of bytes to be read
     *
     * @return number of bytes read (may be less than aCount).
     * @return 0 if reached end-of-file
     *
     * @throws NS_BASE_STREAM_WOULD_BLOCK if reading from the input stream would
     *   block the calling thread (non-blocking mode only)
     * @throws <other-error> on failure
     *
     * NOTE: this method should not throw NS_BASE_STREAM_CLOSED.
     */

[noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount);

[src]

/**
     * @return true if stream is non-blocking
     *
     * NOTE: reading from a blocking input stream will block the calling thread
     * until at least one byte of data can be extracted from the stream.
     *
     * NOTE: a non-blocking input stream may implement nsIAsyncInputStream to
     * provide consumers with a way to wait for the stream to have more data
     * once its read method is unable to return any data without blocking.
     */

boolean isNonBlocking ();

Trait Implementations

impl XpCom for nsIMIMEInputStream
[src]

IID: nsIID = nsID(3703367228, 7633, 4530, [185, 77, 145, 246, 212, 154, 49, 97])

[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 nsIMIMEInputStream
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIMIMEInputStream
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.