Crates.io | bitcoinleveldb-util |
lib.rs | bitcoinleveldb-util |
version | 0.1.16-alpha.0 |
source | src |
created_at | 2023-01-18 04:49:52.42962 |
updated_at | 2023-03-31 09:20:22.714806 |
description | basic utilities used throughout leveldb |
homepage | |
repository | https://github.com/klebz/bitcoin-rs |
max_upload_size | |
id | 761511 |
size | 104,286 |
bitcoinleveldb-util
This crate provides utility types and functions
used in other sub-components of the Bitcoin
system. It includes the NoDestructor
type and
related NoDestructorTest
functions, which are
used to ensure that certain objects are not
accidentally destructed during program execution.
Notice: "This crate is part of a direct translation from C++ to Rust of the bitcoin core. As such, some of the function bodies may still be in the process of translation. Please note that this system will become testable once the translation process is complete"
DoNotDestruct
A wrapper type used to indicate that an object
should not be destructed. This type is used in
conjunction with NoDestructor
to ensure that
certain objects are not accidentally destructed
during program execution.
NoDestructor
A type used to store objects that should not be
destructed. This type is used in conjunction with
DoNotDestruct
to ensure that certain objects are
not accidentally destructed during program
execution.
NoDestructorTest
A set of functions used to test the NoDestructor
type and related functionality. These tests ensure
that objects stored in a NoDestructor
are not
destructed during program execution, even in the
event of an exception or other unexpected
behavior.
get_name
A function that returns the name of an object. This function is used to provide a consistent naming convention for objects throughout the Bitcoin system.
name
A type that represents the name of an object. This
type is used in conjunction with get_name
to
provide a consistent naming convention for objects
throughout the Bitcoin system.
usage
A type that represents the usage of an
object. This type is used in conjunction with
get_name
to provide a consistent usage
convention for objects throughout the Bitcoin
system.
instance_storage_
A global variable used to store instances of the
NoDestructor
type. This variable is used to
ensure that objects stored in a NoDestructor
are
not accidentally destructed during program
execution.
87> which utilities do we use in leveldb?
The bitcoinleveldb-util
crate provides various
utility functions and types that are used
throughout the LevelDB implementation. Some of
these utilities include NoDestructor
,
DoNotDestruct
, and Usage
, which are used for
memory management and object destruction, and
get_name
and name
, which are used to retrieve
and store the names of various components of the
database. These utilities are used in various
parts of the LevelDB implementation, including the
block cache, the iterator implementation, and the
file reader and writer.