Skip to main content

Crate hopr_types

Crate hopr_types 

Source
Expand description

Contains all HOPR-specific or related Rust types.

§HOPR Types

Crates.io docs.rs Security License MSRV Crates.io Downloads codecov Bencher

A collection of Rust types used within the HOPR network and related projects.

The exposed types are used in both internal and external HOPR APIs. External APIs may choose to re-export them and externalize them.

External users of the hopr-lib may not use this crate directly, but rather rely on the exported types thereby.

§Features

This is a single unified crate with feature-gated modules. Enable the features you need:

FeatureModulePurpose
primitiveprimitiveCommon primitive types used throughout the entire codebase.
randomcrypto_randomCommonly used randomness utilities using a cryptographically secure random generator.
cryptocryptoImplementation of basic cryptographic primitives and related types.
internalinternalHOPR-specific types required internally by the HOPR node.
chainchainCore Ethereum-specific types and interactions with the backend database.

Use all-types to enable all of the above. Features form a dependency chain: chaininternalcryptoprimitive + random.

§License

This project is licensed under the GPL-3.0-only.

Modules§

chain
Blockchain-related types. This module contains various on-chain related modules and types.
crypto
Cryptography-related types. This Rust crate contains implementation of common cryptographic types.
crypto_random
Cryptographically secure random number generation. This Rust crate contains implementation of common random number generation functions. All functions and types from this crate supply cryptographically secure random numbers.
internal
Types internally used by the HOPR protocol. This module contains all types that are specific to the HOPR protocol. As opposed to the primitive module, which contains more generic types (not necessarily specific only to HOPR).
keypair
Key pair management and Ethereum keystore support.
primitive
Basic public types used in the HOPR protocol. This crate contains basic types used throughout the entire HOPR codebase. Types from this crate are not necessarily specific only to HOPR.
telemetry
OpenTelemetry-backed metrics collection.

Macros§

histogram_start_measure
Macro to start a timer measurement on a histogram.