Skip to main content

Module common

Module common 

Source
Expand description

Manages the storage layer, raw data types, and shared utilities.

This module provides the storage engine along with fundamental types such as RawKey, RawValue, and environment management functions.

§Common components

This module provides common components and utilities used throughout the VSDB framework. It includes type definitions, constants, macros, and functions for managing the underlying database environment.

Structs§

VsDB
A struct representing the VsDB database.

Constants§

BIGGEST_RESERVED_ID
The biggest reserved ID.
GB
A constant representing 1 gigabyte in bytes.
KB
A constant representing 1 kilobyte in bytes.
MB
A constant representing 1 megabyte in bytes.
NULL
A constant representing a null or empty byte slice.
PREFIX_SIZE
The size of a prefix in bytes.

Statics§

VSDB
The global instance of the VsDB database.

Traits§

BatchTrait
Trait for batch write operations

Functions§

vsdb_flush
Flushes all data to disk.
vsdb_get_base_dir
Returns the base directory path for VSDB.
vsdb_get_custom_dir
Returns the custom directory path for VSDB.
vsdb_get_meta_dir
Returns the instance-meta directory path for VSDB.
vsdb_meta_path
Returns the meta file path for a given instance ID.
vsdb_set_base_dir
Sets the base directory path for VSDB manually.

Type Aliases§

Pre
A type alias for a prefix, represented as a u64.
PreBytes
A type alias for a prefix represented as a byte array.
RawBytes
A type alias for a vector of bytes, commonly used for raw data.
RawKey
A type alias for a raw key, represented as a vector of bytes.
RawValue
A type alias for a raw value, represented as a vector of bytes.