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- Usestokioas the async runtime.
If you use --no-default-features, you can switch to other runtimes:
default-async-std- Usesasync-stdas the async runtime.default-wasm- When building for thewasm32architecture, use this to enablewasm-bindgen-futuresas 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§
- Aligned
U64 - Allow
Offline - Answer
Stats - Measurement of round-trip RPC question/answer performance
- ApiTracing
Layer - API Tracing layer for ‘tracing’ subscribers
- Async
Crypto System Guard - Async cryptosystem guard to help break up heavy blocking operations
- Bare
Decapsulation Key - Bare
Encapsulation Key - Bare
Hash Digest - Bare
KeyPair - Bare
Member Id - Bare
Node Id - Bare
Opaque Record Key - Bare
Public Key - Bare
Record Key - Bare
Route Id - Bare
Secret Key - Bare
Shared Secret - Bare
Signature - Blake3
Digest512 - Byte
Count - Crypto
- Crypto factory implementation
- Crypto
Kind - A four-character code
- Crypto
System Guard - Guard to access a particular cryptosystem
- DHTRecord
Descriptor - DHT Record Descriptor
- DHTRecord
Report - DHT Record Report
- DHTSchemaDFLT
- Default DHT Schema (DFLT)
- DHTSchemaSMPL
- Simple DHT Schema (SMPL)
- DHTSchemaSMPL
Member - Simple DHT Schema (SMPL) Member
- DHTTransaction
- DHT Transactions the way you perform multiple simulateous atomic operations over a set of DHT records.
- DHTTransaction
SetValue Options - Options that override defaults for DHTTransaction::set
- Decapsulation
Key - Decapsulation
KeyGroup - Encapsulation
Key - Encapsulation
KeyGroup - FmtStrip
Veilid Fields - A filter for the
fmttracing layer that can be used to remove the Veilid-specific fields from the output Useful for getting the veilid-internal__VEILID_LOG_KEYfields gone from layers other thanApiTracingLayertracingfields 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. - Hash
Digest - Hash
Digest Group - KeyPair
- KeyPair
Group - Latency
Stats - Measurement of communications latency to this node over all RPC questions
- LogOutput
- A log output to be included in the
log_outputsparameter ofVeilidLog::try_init - Member
Id - Member
IdGroup - NodeId
- Node
IdGroup - Nonce
- Opaque
Record Key - Opaque
Record KeyGroup - Operation
Id - Peer
Stats - Statistics for a peer in the routing table
- Peer
Table Data - Describe a recently accessed peer
- Protected
Store - Protected
Store Inner - Public
Key - Public
KeyGroup - RPCStats
- Statistics for RPC operations performed on a node
- Record
Key - Record
KeyGroup - Route
Blob - RouteId
- Route
IdGroup - Routing
Context - Routing contexts are the way you specify the communication preferences for Veilid.
- Safety
Spec - Options for safety routes (sender privacy).
- Secret
Key - Secret
KeyGroup - SetDHT
Value Options - Options that override defaults for set_dht_value
- Shared
Secret - Shared
Secret Group - Signature
- Signature
Group - State
Reason Stats - Measurement of what state reasons the node has been in over a time span
- State
Stats - Measurement of what states the node has been in over a time span
- TableDB
- TableDB
Transaction - A TableDB transaction Atomically commits a group of writes or deletes to the TableDB
- Table
Store - Veilid Table Storage. Database for storing key value pairs persistently and securely across runs.
- Timestamp
- Timestamp
Duration - TransactDHT
Records Options - Options for DHT record transactions
- Transfer
Stats - Measurement of how much data has transferred to or from this node over a time span
- Transfer
Stats Down Up - Transfer statistics from a node to our own (down) and
- Value
Data - A DHT value and its metadata
- Value
SeqNum - Value sequence number
- Value
Subkey Range Set - VeilidAPI
- The primary developer entrypoint into
veilid-corefunctionality. - Veilid
AppCall - Direct question blob passed to hosting application for processing to send an eventual AppReply.
- Veilid
AppMessage - Direct statement blob passed to hosting application for processing.
- Veilid
Capability - A four-character code
- Veilid
Component Guard - Veilid
Config - Top level of the Veilid configuration tree
- Veilid
Config Block Store - Veilid
Config Capabilities - Veilid
ConfigDHT - 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.
- Veilid
ConfigHTTP - Enable and configure HTTP access to the Veilid node.
- Veilid
ConfigHTTPS - Enable and configure HTTPS access to the Veilid node.
- Veilid
Config Network - Veilid
Config Privacy - Privacy preferences for routes.
- Veilid
Config Protected Store - Veilid
Config Protocol - Configure Network Protocols.
- Veilid
ConfigRPC - Configure RPC.
- Veilid
Config Routing Table - Configure the network routing table.
- Veilid
ConfigTCP - Enable and configure TCP.
- Veilid
ConfigTLS - Configure TLS.
- Veilid
Config Table Store - Veilid
ConfigUDP - Enable and configure UDP.
- Veilid
ConfigWS - Enable and configure Web Sockets.
- Veilid
Layer Filter - Veilid
Layer Filter Config - How to initialize the list of filtered facilities
- Veilid
Log - A VeilidCore log message with optional backtrace.
- Veilid
LogDirective - Changes to the VeilidLayerFilter enabled facilities
- Veilid
Route Change - Describe a private route change that has happened
- Veilid
Startup Options - The configuration built for each Veilid node during API startup
- Veilid
State - A queriable state of the internals of veilid-core.
- Veilid
State Attachment - Describe the attachment state of the Veilid node
- Veilid
State Config - 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.
- Veilid
State Network - Describe the current network state of the Veilid node
- Veilid
Tracing - A simple high-level logging mechanism for Veilid applications
- Veilid
Value Change - Describe when DHT records have subkey values changed
Enums§
- Attachment
State - Attachment abstraction for network ‘signal strength’.
- DHTReport
Scope - DHT Record Report Scope
- DHTSchema
- Enum over all the supported DHT Schemas
- LogOutput
Kind - Safety
Selection - The choice of safety route to include in compiled routes.
- Sequence
Ordering - Sequencing
- Stability
- Target
- Valid destinations for a message sent over a routing context.
- VeilidAPI
Error - Veilid
Config LogLevel - Veilid
LogKey Filter Mode - Veilid
LogLevel - Log level for VeilidCore.
- Veilid
Update - 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
VeilidAPIis 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§
Traits§
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§
- Sequence
Ordering Set - Update
Callback - Value
Subkey - Value subkey
- VeilidAPI
Result - Veilid
Layer LogKey Filter - 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 severalVeilidAPIinstances - Veilid
LogKey - A log filtering key that is a combination of the ‘program name’ and ‘namespace’ of the
VeilidAPIinstance This has a static lifetime because it is used in theveilid_log!()macros
Attribute Macros§
- async_
trait - Re-exported from
async-traitcrate