pub trait CacheExt: IsA<Cache> + Sealed + 'static {
// Provided methods
fn clear(&self) { ... }
fn dump(&self) { ... }
fn flush(&self) { ... }
fn max_size(&self) -> u32 { ... }
fn load(&self) { ... }
fn set_max_size(&self, max_size: u32) { ... }
fn cache_dir(&self) -> Option<GString> { ... }
fn cache_type(&self) -> CacheType { ... }
}
Provided Methods§
sourcefn clear(&self)
fn clear(&self)
Will remove all entries in the @self plus all the cache files.
This is not thread safe and must be called only from the thread that created the #SoupCache
sourcefn dump(&self)
fn dump(&self)
Synchronously writes the cache index out to disk.
Contrast with flush()
, which writes pending cache entries to
disk.
You must call this before exiting if you want your cache data to persist between sessions.
This is not thread safe and must be called only from the thread that created the #SoupCache
sourcefn flush(&self)
fn flush(&self)
Forces all pending writes in the @self to be committed to disk.
For doing so it will iterate the glib::MainContext
associated with
@self’s session as long as needed.
Contrast with dump()
, which writes out the cache index file.
sourcefn load(&self)
fn load(&self)
Loads the contents of @self’s index into memory.
This is not thread safe and must be called only from the thread that created the #SoupCache
sourcefn set_max_size(&self, max_size: u32)
fn set_max_size(&self, max_size: u32)
sourcefn cache_type(&self) -> CacheType
fn cache_type(&self) -> CacheType
Whether the cache is private or shared.