Struct xpcom::interfaces::nsIStreamLoader [] [src]

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

interface nsIStreamLoader : nsIStreamListener

Methods

impl nsIStreamLoader
[src]

[src]

Cast this nsIStreamLoader to one of its base interfaces.

impl nsIStreamLoader
[src]

[src]

/**
 * Asynchronously loads a channel into a memory buffer.
 *
 * To use this interface, first call init() with a nsIStreamLoaderObserver
 * that will be notified when the data has been loaded. Then call asyncOpen()
 * on the channel with the nsIStreamLoader as the listener. The context
 * argument in the asyncOpen() call will be passed to the onStreamComplete()
 * callback.
 *
 * XXX define behaviour for sizes >4 GB
 */
/**
     * Initialize this stream loader, and start loading the data.
     *
     * @param aStreamObserver
     *        An observer that will be notified when the data is complete.
     * @param aRequestObserver
     *        An optional observer that will be notified when the request
     *        has started or stopped.
     */

void init (in nsIStreamLoaderObserver aStreamObserver, [optional] in nsIRequestObserver aRequestObserver);

[src]

/**
     * Gets the number of bytes read so far.
     */

readonly attribute unsigned long numBytesRead;

[src]

/**
     * Gets the request that loaded this file.
     * null after the request has finished loading.
     */

readonly attribute nsIRequest request;

Methods from Deref<Target = nsIStreamListener>

[src]

Cast this nsIStreamListener to one of its base interfaces.

[src]

/**
     * Called when the next chunk of data (corresponding to the request) may
     * be read without blocking the calling thread.  The onDataAvailable impl
     * must read exactly |aCount| bytes of data before returning.
     *
     * @param aRequest request corresponding to the source of the data
     * @param aContext user defined context
     * @param aInputStream input stream containing the data chunk
     * @param aOffset
     *        Number of bytes that were sent in previous onDataAvailable calls
     *        for this request. In other words, the sum of all previous count
     *        parameters.
     * @param aCount number of bytes available in the stream
     *
     * NOTE: The aInputStream parameter must implement readSegments.
     *
     * An exception thrown from onDataAvailable has the side-effect of
     * causing the request to be canceled.
     */

void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long long aOffset, in unsigned long aCount);

Trait Implementations

impl XpCom for nsIStreamLoader
[src]

IID: nsIID = nsID(842780657, 29971, 19999, [165, 65, 28, 146, 19, 194, 237, 27])

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

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIStreamLoader
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.