Struct xpcom::interfaces::nsIContentSniffer
[−]
[src]
#[repr(C)]pub struct nsIContentSniffer { /* fields omitted */ }
interface nsIContentSniffer : nsISupports
/**
* Content sniffer interface. Components implementing this interface can
* determine a MIME type from a chunk of bytes.
*/
Methods
impl nsIContentSniffer
[src]
pub fn coerce<T: nsIContentSnifferCoerce>(&self) -> &T
[src]
Cast this nsIContentSniffer
to one of its base interfaces.
impl nsIContentSniffer
[src]
pub unsafe fn GetMIMETypeFromContent(
&self,
aRequest: *const nsIRequest,
aData: *const uint8_t,
aLength: uint32_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aRequest: *const nsIRequest,
aData: *const uint8_t,
aLength: uint32_t,
_retval: &mut nsACString
) -> nsresult
/**
* Given a chunk of data, determines a MIME type. Information from the given
* request may be used in order to make a better decision.
*
* @param aRequest The request where this data came from. May be null.
* @param aData Data to check
* @param aLength Length of the data
*
* @return The content type
*
* @throw NS_ERROR_NOT_AVAILABLE if no MIME type could be determined.
*
* @note Implementations should consider the request read-only. Especially,
* they should not attempt to set the content type property that subclasses of
* nsIRequest might offer.
*/
ACString getMIMETypeFromContent (in nsIRequest aRequest, [array, size_is (aLength), const] in octet aData, in unsigned long aLength);
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 nsIContentSniffer
[src]
const IID: nsIID
IID: nsIID = nsID(2776050971, 64611, 18782, [161, 105, 150, 232, 211, 49, 26, 240])
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 nsIContentSniffer
[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 nsIContentSniffer
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.