pub struct SizeTargets {
    pub count: u64,
    pub size: u64,
}
Expand description

Size targets for a store. Gc of non-pinned blocks will start once one of the size targets is exceeded.

There are targets for both block count and block size. The reason for this is that a store that has a very large number of tiny blocks will become sluggish despite not having a large total size.

Size targets only apply to non-pinned blocks. Pinned blocks will never be gced even if exceeding one of the size targets.

Fields

count: u64

target number of blocks.

Up to this number, the store will retain everything even if not pinned. Once this number is exceeded, the store will run garbage collection of all unpinned blocks until the block criterion is met again.

To completely disable storing of non-pinned blocks, set this to 0. Even then, the store will never delete pinned blocks.

size: u64

target store size.

Up to this size, the store will retain everything even if not pinned. Once this size is exceeded, the store will run garbage collection of all unpinned blocks until the size criterion is met again.

The store will never delete pinned blocks.

Implementations

Size targets that can not be reached. This can be used to disable gc.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Scrape the references from an impl Read. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more