pub trait SnapshotBuild<F: Family>:
SnapshotBuildSealed
+ Index<Value = Location<F>>
+ Sized
+ 'static {
type Concurrency: Copy + Send + 'static;
// Provided method
async fn build_snapshot<E, C>(
&mut self,
_context: E,
inactivity_floor_loc: Location<F>,
log: &Arc<C>,
_init_concurrency: Self::Concurrency,
init_buffer: NonZeroUsize,
cache_size: Option<NonZeroUsize>,
) -> Result<(usize, BitMap), Error<F>>
where E: Spawner,
C: Contiguous<Item: Operation<F>> + 'static { ... }
}Expand description
Builds a database’s snapshot index from the operations log.
Generic over the Index type so each index controls how it builds: serially with the default
method body, or split across parallel workers with an override.
Sealed: only in-crate index types implement this, so internal invariants (e.g. builds must drop every clone of the shared log before returning) are enforced by the implementations rather than the public contract.
Required Associated Types§
Sourcetype Concurrency: Copy + Send + 'static
type Concurrency: Copy + Send + 'static
The concurrency configuration the build consumes. Index types that always build serially
declare (), so a setting they cannot use is unrepresentable.
Provided Methods§
Sourceasync fn build_snapshot<E, C>(
&mut self,
_context: E,
inactivity_floor_loc: Location<F>,
log: &Arc<C>,
_init_concurrency: Self::Concurrency,
init_buffer: NonZeroUsize,
cache_size: Option<NonZeroUsize>,
) -> Result<(usize, BitMap), Error<F>>
async fn build_snapshot<E, C>( &mut self, _context: E, inactivity_floor_loc: Location<F>, log: &Arc<C>, _init_concurrency: Self::Concurrency, init_buffer: NonZeroUsize, cache_size: Option<NonZeroUsize>, ) -> Result<(usize, BitMap), Error<F>>
Replay log from inactivity_floor_loc, populating self. Returns the number of active
keys and the activity status of every replayed location, in location order: a location’s
bit is set iff it holds the current operation of an active key or is the last commit.
init_buffer sizes the replay read buffer (in bytes), and cache_size bounds each
build’s (location -> key) cache (None disables it).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".