Struct xpcom::interfaces::nsIStreamBufferAccess
[−]
[src]
#[repr(C)]pub struct nsIStreamBufferAccess { /* fields omitted */ }
interface nsIStreamBufferAccess : nsISupports
/**
* An interface for access to a buffering stream implementation's underlying
* memory buffer.
*
* Stream implementations that QueryInterface to nsIStreamBufferAccess must
* ensure that all buffers are aligned on the most restrictive type size for
* the current architecture (e.g., sizeof(double) for RISCy CPUs). malloc(3)
* satisfies this requirement.
*/
Methods
impl nsIStreamBufferAccess
[src]
pub fn coerce<T: nsIStreamBufferAccessCoerce>(&self) -> &T
[src]
Cast this nsIStreamBufferAccess
to one of its base interfaces.
impl nsIStreamBufferAccess
[src]
pub unsafe fn GetBuffer(
&self,
aLength: uint32_t,
aAlignMask: uint32_t
) -> *mut u8
[src]
&self,
aLength: uint32_t,
aAlignMask: uint32_t
) -> *mut u8
/**
* Get access to a contiguous, aligned run of bytes in the stream's buffer.
* Exactly one successful getBuffer call must occur before a putBuffer call
* taking the non-null pointer returned by the successful getBuffer.
*
* The run of bytes are the next bytes (modulo alignment padding) to read
* for an input stream, and the next bytes (modulo alignment padding) to
* store before (eventually) writing buffered data to an output stream.
* There can be space beyond this run of bytes in the buffer for further
* accesses before the fill or flush point is reached.
*
* @param aLength
* Count of contiguous bytes requested at the address A that satisfies
* (A & aAlignMask) == 0 in the buffer, starting from the current stream
* position, mapped to a buffer address B. The stream implementation
* must pad from B to A by skipping bytes (if input stream) or storing
* zero bytes (if output stream).
*
* @param aAlignMask
* Bit-mask computed by subtracting 1 from the power-of-two alignment
* modulus (e.g., 3 or sizeof(uint32_t)-1 for uint32_t alignment).
*
* @return
* The aligned pointer to aLength bytes in the buffer, or null if the
* buffer has no room for aLength bytes starting at the next address A
* after the current position that satisfies (A & aAlignMask) == 0.
*/
[noscript,notxpcom] charPtr getBuffer (in uint32_t aLength, in uint32_t aAlignMask);
pub unsafe fn PutBuffer(&self, aBuffer: *mut u8, aLength: uint32_t) -> c_void
[src]
/**
* Relinquish access to the stream's buffer, filling if at end of an input
* buffer, flushing if completing an output buffer. After a getBuffer call
* that returns non-null, putBuffer must be called.
*
* @param aBuffer
* A non-null pointer returned by getBuffer on the same stream buffer
* access object.
*
* @param aLength
* The same count of contiguous bytes passed to the getBuffer call that
* returned aBuffer.
*/
[noscript,notxpcom] void putBuffer (in charPtr aBuffer, in uint32_t aLength);
pub unsafe fn DisableBuffering(&self) -> nsresult
[src]
/**
* Disable and enable buffering on the stream implementing this interface.
* DisableBuffering flushes an output stream's buffer, and invalidates an
* input stream's buffer.
*/
void disableBuffering ();
pub unsafe fn EnableBuffering(&self) -> nsresult
[src]
void enableBuffering ();
pub unsafe fn GetUnbufferedStream(
&self,
aUnbufferedStream: *mut *const nsISupports
) -> nsresult
[src]
&self,
aUnbufferedStream: *mut *const nsISupports
) -> nsresult
/**
* The underlying, unbuffered input or output stream.
*/
readonly attribute nsISupports unbufferedStream;
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 nsIStreamBufferAccess
[src]
const IID: nsIID
IID: nsIID = nsID(2895264626, 44167, 18578, [172, 122, 202, 56, 93, 66, 148, 53])
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 nsIStreamBufferAccess
[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 nsIStreamBufferAccess
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.