pub trait PageCacheBuiler<T: PageCache> {
// Required method
fn create(page_size: usize, extra_size: usize, bpurgeable: bool) -> T;
}
Required Methods§
Sourcefn create(page_size: usize, extra_size: usize, bpurgeable: bool) -> T
fn create(page_size: usize, extra_size: usize, bpurgeable: bool) -> T
SQLite invokes the create
method to construct a new cache instance.
SQLite will typically create one cache instance for each open database file, though this is
not guaranteed. The first parameter, page_size
, is the size in bytes of the pages that
must be allocated by the cache. page_size
will always a power of two. The second
parameter extra_size
is a number of bytes of extra storage associated with each page
cache entry. The extra_size
parameter will a number less than 250. SQLite will use the
extra extra bytes on each page to store metadata about the underlying database page on
disk. The value passed depends on the SQLite version, the target platform, and how SQLite
was compiled.
The third argument to create
, bpurgeable
, is true if the cache being
created will be used to cache database pages of a file stored on disk, or false if it is
used for an in-memory database. The cache implementation does not have to do anything
special based with the value of bPurgeable; it is purely advisory. On a cache where
bPurgeable is false, SQLite will never invoke [unpin] except to deliberately delete a page.
In other words, calls to [unpin] on a cache with bPurgeable set to false will always have
the “discard” flag set to true. Hence, a cache created with bPurgeable false will never
contain any unpinned pages.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.