Skip to main content

Crate veilid_core

Crate veilid_core 

Source
Expand description

§The Veilid Framework

This is the core library used to create a Veilid node and operate it as part of an application.

veilid-core contains all of the core logic for Veilid and can be used in mobile applications as well as desktop and in-browser WebAssembly apps.

§Getting started

The public API is accessed by getting a VeilidAPI object via a call to api_startup, api_startup_json.

From there, a RoutingContext object can get you access to public and private routed operations.

§Cargo features

The default veilid-core configurations are:

  • default - Uses tokio as the async runtime.

If you use --no-default-features, you can switch to other runtimes:

  • default-async-std - Uses async-std as the async runtime.
  • default-wasm - When building for the wasm32 architecture, use this to enable wasm-bindgen-futures as the async runtime.

Re-exports§

pub use async_trait;
pub use tracing;
pub use tracing_subscriber;
pub use veilid_tools as tools;

Modules§

as_human_base64
as_human_opt_base64
as_human_opt_string
as_human_string
crypto_system
public_key_try_untyped_vld0
serialize_arc
serialize_range_set_blaze
signature_try_untyped_vld0
sizes

Macros§

apibail_already_initialized
apibail_generic
apibail_internal
apibail_invalid_argument
apibail_invalid_target
apibail_key_not_found
apibail_missing_argument
apibail_no_connection
apibail_not_initialized
apibail_parse_error
apibail_route_not_found
apibail_timeout
apibail_try_again
fourcc_type
impl_crypto_typed
impl_crypto_typed_group
impl_crypto_typed_vec
impl_veilid_log_facility
log_veilid_api_error
network_result_value_or_log
rpc_ignore_max_len
rpc_ignore_min_max_len
rpc_ignore_missing_property
veilid_log
veilid_log_dbg
veilid_log_err
veilid_log_event

Structs§

AlignedU64
AllowOffline
AnswerStats
Measurement of round-trip RPC question/answer performance
ApiTracingLayer
API Tracing layer for ‘tracing’ subscribers
AsyncCryptoSystemGuard
Async cryptosystem guard to help break up heavy blocking operations
BareDecapsulationKey
BareEncapsulationKey
BareHashDigest
BareKeyPair
BareMemberId
BareNodeId
BareOpaqueRecordKey
BarePublicKey
BareRecordKey
BareRouteId
BareSecretKey
BareSharedSecret
BareSignature
Blake3Digest512
ByteCount
Crypto
Crypto factory implementation
CryptoKind
A four-character code
CryptoSystemGuard
Guard to access a particular cryptosystem
DHTRecordDescriptor
DHT Record Descriptor
DHTRecordReport
DHT Record Report
DHTSchemaDFLT
Default DHT Schema (DFLT)
DHTSchemaSMPL
Simple DHT Schema (SMPL)
DHTSchemaSMPLMember
Simple DHT Schema (SMPL) Member
DHTTransaction
DHT Transactions the way you perform multiple simulateous atomic operations over a set of DHT records.
DHTTransactionSetValueOptions
Options that override defaults for DHTTransaction::set
DecapsulationKey
DecapsulationKeyGroup
EncapsulationKey
EncapsulationKeyGroup
FmtStripVeilidFields
A filter for the fmt tracing layer that can be used to remove the Veilid-specific fields from the output Useful for getting the veilid-internal __VEILID_LOG_KEY fields gone from layers other than ApiTracingLayer tracing fields can not be removed by tracing filters. They can only enable and disable events and spans. To remove fields requires plugging in at the layer separately, and this struct is intended for that purpose to reduce the noise veilid-core’s logging facilities produce.
HashDigest
HashDigestGroup
KeyPair
KeyPairGroup
LatencyStats
Measurement of communications latency to this node over all RPC questions
LogOutput
A log output to be included in the log_outputs parameter of VeilidLog::try_init
MemberId
MemberIdGroup
NodeId
NodeIdGroup
Nonce
OpaqueRecordKey
OpaqueRecordKeyGroup
OperationId
PeerStats
Statistics for a peer in the routing table
PeerTableData
Describe a recently accessed peer
ProtectedStore
ProtectedStoreInner
PublicKey
PublicKeyGroup
RPCStats
Statistics for RPC operations performed on a node
RecordKey
RecordKeyGroup
RouteBlob
RouteId
RouteIdGroup
RoutingContext
Routing contexts are the way you specify the communication preferences for Veilid.
SafetySpec
Options for safety routes (sender privacy).
SecretKey
SecretKeyGroup
SetDHTValueOptions
Options that override defaults for set_dht_value
SharedSecret
SharedSecretGroup
Signature
SignatureGroup
StateReasonStats
Measurement of what state reasons the node has been in over a time span
StateStats
Measurement of what states the node has been in over a time span
TableDB
TableDBTransaction
A TableDB transaction Atomically commits a group of writes or deletes to the TableDB
TableStore
Veilid Table Storage. Database for storing key value pairs persistently and securely across runs.
Timestamp
TimestampDuration
TransactDHTRecordsOptions
Options for DHT record transactions
TransferStats
Measurement of how much data has transferred to or from this node over a time span
TransferStatsDownUp
Transfer statistics from a node to our own (down) and
ValueData
A DHT value and its metadata
ValueSeqNum
Value sequence number
ValueSubkeyRangeSet
VeilidAPI
The primary developer entrypoint into veilid-core functionality.
VeilidAppCall
Direct question blob passed to hosting application for processing to send an eventual AppReply.
VeilidAppMessage
Direct statement blob passed to hosting application for processing.
VeilidCapability
A four-character code
VeilidComponentGuard
VeilidConfig
Top level of the Veilid configuration tree
VeilidConfigBlockStore
VeilidConfigCapabilities
VeilidConfigDHT
Configure the Distributed Hash Table (DHT). Defaults should be used here unless you are absolutely sure you know what you’re doing. If you change the count/fanout/timeout parameters, you may render your node inoperable for correct DHT operations.
VeilidConfigHTTP
Enable and configure HTTP access to the Veilid node.
VeilidConfigHTTPS
Enable and configure HTTPS access to the Veilid node.
VeilidConfigNetwork
VeilidConfigPrivacy
Privacy preferences for routes.
VeilidConfigProtectedStore
VeilidConfigProtocol
Configure Network Protocols.
VeilidConfigRPC
Configure RPC.
VeilidConfigRoutingTable
Configure the network routing table.
VeilidConfigTCP
Enable and configure TCP.
VeilidConfigTLS
Configure TLS.
VeilidConfigTableStore
VeilidConfigUDP
Enable and configure UDP.
VeilidConfigWS
Enable and configure Web Sockets.
VeilidLayerFilter
VeilidLayerFilterConfig
How to initialize the list of filtered facilities
VeilidLog
A VeilidCore log message with optional backtrace.
VeilidLogDirective
Changes to the VeilidLayerFilter enabled facilities
VeilidRouteChange
Describe a private route change that has happened
VeilidStartupOptions
The configuration built for each Veilid node during API startup
VeilidState
A queriable state of the internals of veilid-core.
VeilidStateAttachment
Describe the attachment state of the Veilid node
VeilidStateConfig
Describe changes to the Veilid node configuration Currently this is only ever emitted once, however we reserve the right to add the ability to change the configuration or have it changed by the Veilid node itself during runtime.
VeilidStateNetwork
Describe the current network state of the Veilid node
VeilidTracing
A simple high-level logging mechanism for Veilid applications
VeilidValueChange
Describe when DHT records have subkey values changed

Enums§

AttachmentState
Attachment abstraction for network ‘signal strength’.
DHTReportScope
DHT Record Report Scope
DHTSchema
Enum over all the supported DHT Schemas
LogOutputKind
SafetySelection
The choice of safety route to include in compiled routes.
SequenceOrdering
Sequencing
Stability
Target
Valid destinations for a message sent over a routing context.
VeilidAPIError
VeilidConfigLogLevel
VeilidLogKeyFilterMode
VeilidLogLevel
Log level for VeilidCore.
VeilidUpdate
An update from the veilid-core to the host application describing a change to the internal state of the Veilid node.

Constants§

CONNECTIVITY_CAPABILITIES
CRYPTO_KIND_VLD0
CRYPTO_KIND_VLD0_FOURCC
DISTANCE_METRIC_CAPABILITIES
LOCAL_NETWORK_CAPABILITIES
MAX_CAPABILITIES
MAX_CRYPTO_KINDS
Number of cryptosystem signatures to keep on structures if many are present beyond the ones we consider valid
PUBLIC_INTERNET_CAPABILITIES
VALID_CRYPTO_KINDS
Crypto kinds in order of preference, best cryptosystem is the first one, worst is the last one
VEILID_CAPABILITY_APPMESSAGE
VEILID_CAPABILITY_DHT
VEILID_CAPABILITY_RELAY
VEILID_CAPABILITY_ROUTE
VEILID_CAPABILITY_SIGNAL
VEILID_CAPABILITY_VALIDATE_DIAL_INFO
VEILID_LOG_KEY_FIELD
The tracing log field used by veilid-core to indicate which instance of the VeilidAPI is doing the logging.
VLD0_HASH_DIGEST_LENGTH
Length of a hash digest in bytes
VLD0_NONCE_LENGTH
Length of a nonce in bytes
VLD0_PUBLIC_KEY_LENGTH
Length of a crypto key in bytes
VLD0_SECRET_KEY_LENGTH
Length of a secret key in bytes
VLD0_SHARED_SECRET_LENGTH
Length of a shared secret in bytes
VLD0_SIGNATURE_LENGTH
Length of a signature in bytes

Statics§

KNOWN_PROTECTED_STORE_KEYS

Traits§

CryptoSystem
OkVeilidAPIResult

Functions§

api_startup
Initialize a Veilid node, with the configuration object.
api_startup_json
Initialize a Veilid node, with the configuration in JSON format.
common_crypto_kinds
Intersection of crypto kind vectors
compare_crypto_kind
Sort best crypto kinds first Better crypto kinds are ‘less’, ordered toward the front of a list
compress_prepend_size
decompress_size_prepended
default_veilid_config
Return the default veilid config as a json object.
deserialize_json
deserialize_json_bytes
deserialize_opt_json
deserialize_opt_json_bytes
get_default_ssl_directory
print_data
serialize_json
serialize_json_bytes
veilid_features
Return the features that were enabled when veilid-core was built.
veilid_version
Return the cargo package version of veilid-core in tuple format.
veilid_version_string
Return the cargo package version of veilid-core in string format.

Type Aliases§

SequenceOrderingSet
UpdateCallback
ValueSubkey
Value subkey
VeilidAPIResult
VeilidLayerLogKeyFilter
The type of a filtering closure accepted by VeilidLayerFilter. The filter is passed a log key to filter on and returns true if the log key matches the desired log key of the application. This is an advanced filter for when a basic string comparison against a VeilidLogKey is insufficient, for example defining a logging layer that aggregates the logs of several VeilidAPI instances
VeilidLogKey
A log filtering key that is a combination of the ‘program name’ and ‘namespace’ of the VeilidAPI instance This has a static lifetime because it is used in the veilid_log!() macros

Attribute Macros§

async_trait
Re-exported from async-trait crate