Struct xpcom::interfaces::nsIStreamListenerTee [] [src]

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

interface nsIStreamListenerTee : nsIStreamListener

/**
 * As data "flows" into a stream listener tee, it is copied to the output stream
 * and then forwarded to the real listener.
 */

Methods

impl nsIStreamListenerTee
[src]

[src]

Cast this nsIStreamListenerTee to one of its base interfaces.

impl nsIStreamListenerTee
[src]

[src]

/**
     * Initalize the tee.
     *
     * @param listener
     *    the original listener the tee will propagate onStartRequest,
     *    onDataAvailable and onStopRequest notifications to, exceptions from
     *    the listener will be propagated back to the channel
     * @param sink
     *    the stream the data coming from the channel will be written to,
     *    should be blocking
     * @param requestObserver
     *    optional parameter, listener that gets only onStartRequest and
     *    onStopRequest notifications; exceptions threw within this optional
     *    observer are also propagated to the channel, but exceptions from
     *    the original listener (listener parameter) are privileged
     */

void init (in nsIStreamListener listener, in nsIOutputStream sink, [optional] in nsIRequestObserver requestObserver);

[src]

/**
     * Initalize the tee like above, but with the extra parameter to make it
     * possible to copy the output asynchronously
     * @param anEventTarget
     *    if set, this event-target is used to copy data to the output stream,
     *    giving an asynchronous tee
    */

void initAsync (in nsIStreamListener listener, in nsIEventTarget eventTarget, in nsIOutputStream sink, [optional] in nsIRequestObserver requestObserver);

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

IID: nsIID = nsID(1655865281, 28300, 16933, [138, 208, 185, 212, 66, 82, 151, 58])

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

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIStreamListenerTee
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.