Trait soup::prelude::CacheExt

source ·
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 { ... }
}
Expand description

Trait containing all Cache methods.

§Implementors

Cache

Provided Methods§

source

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

source

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

source

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.

source

fn max_size(&self) -> u32

Gets the maximum size of the cache.

§Returns

the maximum size of the cache, in bytes.

source

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

source

fn set_max_size(&self, max_size: u32)

Sets the maximum size of the cache.

§max_size

the maximum size of the cache, in bytes

source

fn cache_dir(&self) -> Option<GString>

The directory to store the cache files.

source

fn cache_type(&self) -> CacheType

Whether the cache is private or shared.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Cache>> CacheExt for O