Struct xpcom::interfaces::nsIArrayBufferInputStream
[−]
[src]
#[repr(C)]pub struct nsIArrayBufferInputStream { /* fields omitted */ }
interface nsIArrayBufferInputStream : nsIInputStream
/**
* nsIArrayBufferInputStream
*
* Provides scriptable methods for initializing a nsIInputStream
* implementation with an ArrayBuffer.
*/
Methods
impl nsIArrayBufferInputStream
[src]
pub fn coerce<T: nsIArrayBufferInputStreamCoerce>(&self) -> &T
[src]
Cast this nsIArrayBufferInputStream
to one of its base interfaces.
Methods from Deref<Target = nsIInputStream>
pub fn coerce<T: nsIInputStreamCoerce>(&self) -> &T
[src]
Cast this nsIInputStream
to one of its base interfaces.
pub unsafe fn Close(&self) -> nsresult
[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 ();
pub unsafe fn Available(&self, _retval: *mut uint64_t) -> nsresult
[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 ();
pub unsafe fn Read(
&self,
aBuf: *mut u8,
aCount: uint32_t,
_retval: *mut uint32_t
) -> nsresult
[src]
&self,
aBuf: *mut u8,
aCount: uint32_t,
_retval: *mut uint32_t
) -> nsresult
/**
* 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);
pub unsafe fn IsNonBlocking(&self, _retval: *mut bool) -> nsresult
[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 nsIArrayBufferInputStream
[src]
const IID: nsIID
IID: nsIID = nsID(806673894, 43548, 16859, [135, 208, 72, 118, 74, 55, 16, 246])
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 nsIArrayBufferInputStream
[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 nsIArrayBufferInputStream
[src]
type Target = nsIInputStream
The resulting type after dereferencing.
fn deref(&self) -> &nsIInputStream
[src]
Dereferences the value.