Struct xpcom::interfaces::nsICacheEntryDescriptor
[−]
[src]
#[repr(C)]pub struct nsICacheEntryDescriptor { /* fields omitted */ }
interface nsICacheEntryDescriptor : nsICacheEntryInfo
Methods
impl nsICacheEntryDescriptor
[src]
pub fn coerce<T: nsICacheEntryDescriptorCoerce>(&self) -> &T
[src]
Cast this nsICacheEntryDescriptor
to one of its base interfaces.
impl nsICacheEntryDescriptor
[src]
pub unsafe fn SetExpirationTime(&self, expirationTime: uint32_t) -> nsresult
[src]
/**
* Set the time at which the cache entry should be considered invalid (in
* seconds since the Epoch).
*/
void setExpirationTime (in uint32_t expirationTime);
pub unsafe fn SetDataSize(&self, size: uint32_t) -> nsresult
[src]
/**
* Set the cache entry data size. This will fail if the cache entry
* IS stream based.
*/
void setDataSize (in unsigned long size);
pub unsafe fn OpenInputStream(
&self,
offset: uint32_t,
_retval: *mut *const nsIInputStream
) -> nsresult
[src]
&self,
offset: uint32_t,
_retval: *mut *const nsIInputStream
) -> nsresult
/**
* Open blocking input stream to cache data. This will fail if the cache
* entry IS NOT stream based. Use the stream transport service to
* asynchronously read this stream on a background thread. The returned
* stream MAY implement nsISeekableStream.
*
* @param offset
* read starting from this offset into the cached data. an offset
* beyond the end of the stream has undefined consequences.
*
* @return blocking, unbuffered input stream.
*/
nsIInputStream openInputStream (in unsigned long offset);
pub unsafe fn OpenOutputStream(
&self,
offset: uint32_t,
_retval: *mut *const nsIOutputStream
) -> nsresult
[src]
&self,
offset: uint32_t,
_retval: *mut *const nsIOutputStream
) -> nsresult
/**
* Open blocking output stream to cache data. This will fail if the cache
* entry IS NOT stream based. Use the stream transport service to
* asynchronously write to this stream on a background thread. The returned
* stream MAY implement nsISeekableStream.
*
* If opening an output stream to existing cached data, the data will be
* truncated to the specified offset.
*
* @param offset
* write starting from this offset into the cached data. an offset
* beyond the end of the stream has undefined consequences.
*
* @return blocking, unbuffered output stream.
*/
nsIOutputStream openOutputStream (in unsigned long offset);
pub unsafe fn GetCacheElement(
&self,
aCacheElement: *mut *const nsISupports
) -> nsresult
[src]
&self,
aCacheElement: *mut *const nsISupports
) -> nsresult
/**
* Get/set the cache data element. This will fail if the cache entry
* IS stream based. The cache entry holds a strong reference to this
* object. The object will be released when the cache entry is destroyed.
*/
attribute nsISupports cacheElement;
pub unsafe fn SetCacheElement(
&self,
aCacheElement: *const nsISupports
) -> nsresult
[src]
&self,
aCacheElement: *const nsISupports
) -> nsresult
/**
* Get/set the cache data element. This will fail if the cache entry
* IS stream based. The cache entry holds a strong reference to this
* object. The object will be released when the cache entry is destroyed.
*/
attribute nsISupports cacheElement;
pub unsafe fn GetPredictedDataSize(
&self,
aPredictedDataSize: *mut int64_t
) -> nsresult
[src]
&self,
aPredictedDataSize: *mut int64_t
) -> nsresult
/**
* Stores the Content-Length specified in the HTTP header for this
* entry. Checked before we write to the cache entry, to prevent ever
* taking up space in the cache for an entry that we know up front
* is going to have to be evicted anyway. See bug 588507.
*/
attribute int64_t predictedDataSize;
pub unsafe fn SetPredictedDataSize(
&self,
aPredictedDataSize: int64_t
) -> nsresult
[src]
&self,
aPredictedDataSize: int64_t
) -> nsresult
/**
* Stores the Content-Length specified in the HTTP header for this
* entry. Checked before we write to the cache entry, to prevent ever
* taking up space in the cache for an entry that we know up front
* is going to have to be evicted anyway. See bug 588507.
*/
attribute int64_t predictedDataSize;
pub unsafe fn GetAccessGranted(
&self,
aAccessGranted: *mut nsCacheAccessMode
) -> nsresult
[src]
&self,
aAccessGranted: *mut nsCacheAccessMode
) -> nsresult
/**
* Get the access granted to this descriptor. See nsICache.idl for the
* definitions of the access modes and a thorough description of their
* corresponding meanings.
*/
readonly attribute nsCacheAccessMode accessGranted;
pub unsafe fn GetStoragePolicy(
&self,
aStoragePolicy: *mut nsCacheStoragePolicy
) -> nsresult
[src]
&self,
aStoragePolicy: *mut nsCacheStoragePolicy
) -> nsresult
/**
* Get/set the storage policy of the cache entry. See nsICache.idl for
* the definitions of the storage policies.
*/
attribute nsCacheStoragePolicy storagePolicy;
pub unsafe fn SetStoragePolicy(
&self,
aStoragePolicy: nsCacheStoragePolicy
) -> nsresult
[src]
&self,
aStoragePolicy: nsCacheStoragePolicy
) -> nsresult
/**
* Get/set the storage policy of the cache entry. See nsICache.idl for
* the definitions of the storage policies.
*/
attribute nsCacheStoragePolicy storagePolicy;
pub unsafe fn GetFile(&self, aFile: *mut *const nsIFile) -> nsresult
[src]
/**
* Get the disk file associated with the cache entry.
*/
readonly attribute nsIFile file;
pub unsafe fn GetSecurityInfo(
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
[src]
&self,
aSecurityInfo: *mut *const nsISupports
) -> nsresult
/**
* Get/set security info on the cache entry for this descriptor. This fails
* if the storage policy is not STORE_IN_MEMORY.
*/
attribute nsISupports securityInfo;
pub unsafe fn SetSecurityInfo(
&self,
aSecurityInfo: *const nsISupports
) -> nsresult
[src]
&self,
aSecurityInfo: *const nsISupports
) -> nsresult
/**
* Get/set security info on the cache entry for this descriptor. This fails
* if the storage policy is not STORE_IN_MEMORY.
*/
attribute nsISupports securityInfo;
pub unsafe fn GetStorageDataSize(
&self,
aStorageDataSize: *mut uint32_t
) -> nsresult
[src]
&self,
aStorageDataSize: *mut uint32_t
) -> nsresult
/**
* Get the size of the cache entry data, as stored. This may differ
* from the entry's dataSize, if the entry is compressed.
*/
readonly attribute unsigned long storageDataSize;
pub unsafe fn Doom(&self) -> nsresult
[src]
/**
* Doom the cache entry this descriptor references in order to slate it for
* removal. Once doomed a cache entry cannot be undoomed.
*
* A descriptor with WRITE access can doom the cache entry and choose to
* fail pending requests. This means that pending requests will not get
* a cache descriptor. This is meant as a tool for clients that wish to
* instruct pending requests to skip the cache.
*/
void doom ();
pub unsafe fn DoomAndFailPendingRequests(&self, status: nsresult) -> nsresult
[src]
void doomAndFailPendingRequests (in nsresult status);
pub unsafe fn AsyncDoom(&self, listener: *const nsICacheListener) -> nsresult
[src]
/**
* Asynchronously doom an entry. Listener will be notified about the status
* of the operation. Null may be passed if caller doesn't care about the
* result.
*/
void asyncDoom (in nsICacheListener listener);
pub unsafe fn MarkValid(&self) -> nsresult
[src]
/**
* A writer must validate this cache object before any readers are given
* a descriptor to the object.
*/
void markValid ();
pub unsafe fn Close(&self) -> nsresult
[src]
/**
* Explicitly close the descriptor (optional).
*/
void close ();
pub unsafe fn GetMetaDataElement(
&self,
key: *const c_char,
_retval: *mut *const c_char
) -> nsresult
[src]
&self,
key: *const c_char,
_retval: *mut *const c_char
) -> nsresult
/**
* Methods for accessing meta data. Meta data is a table of key/value
* string pairs. The strings do not have to conform to any particular
* charset, but they must be null terminated.
*/
string getMetaDataElement (in string key);
pub unsafe fn SetMetaDataElement(
&self,
key: *const c_char,
value: *const c_char
) -> nsresult
[src]
&self,
key: *const c_char,
value: *const c_char
) -> nsresult
void setMetaDataElement (in string key, in string value);
pub unsafe fn VisitMetaData(
&self,
visitor: *const nsICacheMetaDataVisitor
) -> nsresult
[src]
&self,
visitor: *const nsICacheMetaDataVisitor
) -> nsresult
/**
* Visitor will be called with key/value pair for each meta data element.
*/
void visitMetaData (in nsICacheMetaDataVisitor visitor);
Methods from Deref<Target = nsICacheEntryInfo>
pub fn coerce<T: nsICacheEntryInfoCoerce>(&self) -> &T
[src]
Cast this nsICacheEntryInfo
to one of its base interfaces.
pub unsafe fn GetClientID(&self, aClientID: &mut nsACString) -> nsresult
[src]
/**
* Get the client id associated with this cache entry.
*/
readonly attribute ACString clientID;
pub unsafe fn GetDeviceID(&self, aDeviceID: &mut nsACString) -> nsresult
[src]
/**
* Get the id for the device that stores this cache entry.
*/
readonly attribute ACString deviceID;
pub unsafe fn GetKey(&self, aKey: &mut nsACString) -> nsresult
[src]
/**
* Get the key identifying the cache entry.
*/
readonly attribute ACString key;
pub unsafe fn GetFetchCount(&self, aFetchCount: *mut int32_t) -> nsresult
[src]
/**
* Get the number of times the cache entry has been opened.
*/
readonly attribute long fetchCount;
pub unsafe fn GetLastFetched(&self, aLastFetched: *mut uint32_t) -> nsresult
[src]
/**
* Get the last time the cache entry was opened (in seconds since the Epoch).
*/
readonly attribute uint32_t lastFetched;
pub unsafe fn GetLastModified(&self, aLastModified: *mut uint32_t) -> nsresult
[src]
/**
* Get the last time the cache entry was modified (in seconds since the Epoch).
*/
readonly attribute uint32_t lastModified;
pub unsafe fn GetExpirationTime(
&self,
aExpirationTime: *mut uint32_t
) -> nsresult
[src]
&self,
aExpirationTime: *mut uint32_t
) -> nsresult
/**
* Get the expiration time of the cache entry (in seconds since the Epoch).
*/
readonly attribute uint32_t expirationTime;
pub unsafe fn GetDataSize(&self, aDataSize: *mut uint32_t) -> nsresult
[src]
/**
* Get the cache entry data size.
*/
readonly attribute unsigned long dataSize;
pub unsafe fn IsStreamBased(&self, _retval: *mut bool) -> nsresult
[src]
/**
* Find out whether or not the cache entry is stream based.
*/
boolean isStreamBased ();
Trait Implementations
impl XpCom for nsICacheEntryDescriptor
[src]
const IID: nsIID
IID: nsIID = nsID(2427551025, 18090, 20401, [162, 6, 71, 60, 150, 108, 188, 24])
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 nsICacheEntryDescriptor
[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 nsICacheEntryDescriptor
[src]
type Target = nsICacheEntryInfo
The resulting type after dereferencing.
fn deref(&self) -> &nsICacheEntryInfo
[src]
Dereferences the value.