pub trait Config: Sized {
const INITIAL_PAGE_SIZE: u32 = DefaultConfig::INITIAL_PAGE_SIZE;
const MAX_PAGES: u32 = DefaultConfig::MAX_PAGES;
const RESERVED_BITS: u32 = DefaultConfig::RESERVED_BITS;
// Provided method
fn debug() -> impl Debug { ... }
}Expand description
Configuration parameters to tune the behavior of an IDR.
The capacity of an IDR is determined by the configuration parameters:
(2**MAX_PAGES - 1) * INITIAL_PAGE_SIZEIdr::new() checks that the configuration is valid at compile time.
These checks are triggered by cargo build or cargo test, but not
by cargo check.
Provided Associated Constants§
Sourceconst INITIAL_PAGE_SIZE: u32 = DefaultConfig::INITIAL_PAGE_SIZE
const INITIAL_PAGE_SIZE: u32 = DefaultConfig::INITIAL_PAGE_SIZE
The capacity of the first page.
When a page in an underlying slab has been filled with values, a new page will be allocated that is twice as large as the previous page. Thus, the second page will be twice this size, and the third will be four times this size, and so on.
Must be a power of two.
Sourceconst MAX_PAGES: u32 = DefaultConfig::MAX_PAGES
const MAX_PAGES: u32 = DefaultConfig::MAX_PAGES
The maximum number of pages in an underlying slab of an IDR.
This value, in combination with INITIAL_PAGE_SIZE, determines how many
bits of each key are used to represent slot indices.
Must be positive.
Sourceconst RESERVED_BITS: u32 = DefaultConfig::RESERVED_BITS
const RESERVED_BITS: u32 = DefaultConfig::RESERVED_BITS
A number of high-order bits which are reserved from user code.
Note: these bits are taken from the generation counter; reserving additional bits will decrease the period of the generation counter. These should thus be used relatively sparingly, to ensure that generation counters are able to effectively prevent the ABA problem.
Must be less than or equal to 32.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".