Expand description
§knust — Asynchronous KNX/IP Library for Rust
knust is a high-performance, memory-safe implementation of the KNX/IP protocol for building automation systems. It provides async/await support and strong type safety while maintaining compatibility with KNX standards.
§Features
- Async/await support with tokio
- Memory-safe protocol parsing
- Support for tunneling and routing connections
- Comprehensive error handling
- Property-based testing for correctness
§Cargo features
dpt(on by default) — datapoint-type encode/decode (DPT 1..251). Disable for a raw-frame-only client that never interprets group values; owns thestrumdependency.ets(off) — ETS CSV group-address import (parse_ets_csv). The only consumer of tokio’sfs. Impliesdpt(DPT string parsing).server(off) — act as a KNXnet/IP tunneling server (TunnelServer). Most consumers are clients and don’t need it.secure(off) — KNX IP Secure + KNX Data Security: session handshake, group encryption,.knxkeyskeyring parsing/validation, and the secure server path. Pulls in the crypto stack (aes,x25519-dalek,pbkdf2,sha2, …). Impliesets. KNX IP Secure (the session handshake) is verified against real hardware; KNX Data Security (group encryption, see [security::group]) is experimental and unverified against a reference implementation — see that module’s docs.
§Quick Start
use knust::{Knx, ConnectionConfig, ConnectionType};
#[tokio::main]
async fn main() -> Result<(), knust::KnxError> {
let config = ConnectionConfig {
connection_type: ConnectionType::Tunneling,
gateway_ip: Some("192.168.1.100".parse().unwrap()),
..Default::default()
};
let knx = Knx::new(config).await?;
// Use the library...
Ok(())
}Re-exports§
pub use application::Knx;pub use application::KnxBuilder;pub use application::KnxState;pub use config::ConfigFormat;pub use config::Configuration;pub use error::KnxError;pub use error::Result;pub use logging::Component;pub use logging::LoggingConfig;pub use logging::Timer;pub use memory::ConnectionPool;pub use memory::MemoryError;pub use memory::MemoryMonitor;pub use memory::MemoryStats;pub use memory::PerformanceOptimizer;pub use transport::ConnectionConfig;pub use transport::ConnectionType;
Modules§
- application
- Application layer providing the main Knx library interface.
- config
- Configuration parsing for KNX/IP systems.
- error
- Error types and result aliases for the Knx library.
- logging
- Comprehensive logging and debugging support for Knx.
- memory
- Memory management and performance optimization utilities.
- protocol
- Protocol layer for KNX/IP frame handling and data processing.
- transport
- Transport layer for KNX/IP communication.
Macros§
- dpt_
alias - Macro for creating simple DPT aliases that delegate to existing types
- log_
application - log_
component - Log a formatted message for a specific component
- log_
config - log_
device - log_
discovery - log_
protocol - log_
queue - log_
security - log_
transport - Convenience macros for component-specific logging
Enums§
- LogLevel
- Log levels for different components — re-exported from the
logcrate. An enum representing the available verbosity levels of the logger.
Constants§
- VERSION
- Library version information