Crate amaters_net

Crate amaters_net 

Source
Expand description

Network layer for AmateRS (Musubi - The Knot)

This crate provides the gRPC-based networking layer for AmateRS, implementing secure communication over QUIC with mTLS.

§Features

  • gRPC service for AQL queries
  • Request/response handling with streaming support
  • Error handling and retry strategies
  • Connection state management

§Architecture

The networking layer consists of:

  • Protocol definitions (.proto files)
  • Server implementation (gRPC service)
  • Client implementation (connection management)
  • Error types and conversions

§Example

use amaters_net::client::AqlClient;
use amaters_core::{Key, CipherBlob};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = AqlClient::connect("http://localhost:50051").await?;

    let key = Key::from_str("my_key");
    let value = CipherBlob::new(vec![1, 2, 3]);

    client.set("my_collection", key, value).await?;

    Ok(())
}

Re-exports§

pub use error::NetError;
pub use error::NetResult;
pub use server::AqlServerBuilder;
pub use server::AqlServiceImpl;
pub use mtls::CrlRevocationChecker;
pub use mtls::HandshakeResult;
pub use mtls::MtlsClient;
pub use mtls::MtlsClientVerifier;
pub use mtls::MtlsConfigBuilder;
pub use mtls::MtlsServer;
pub use mtls::MtlsServerVerifier;
pub use mtls::OcspRevocationChecker;
pub use mtls::Principal;
pub use mtls::PrincipalMapper;
pub use mtls::RevocationChecker;
pub use mtls::RevocationStatus;
pub use tls::CertificateFormat;
pub use tls::CertificateInfo;
pub use tls::CertificateLoader;
pub use tls::CertificateStore;
pub use tls::HotReloadableCertificates;
pub use tls::PrivateKeyLoader;
pub use tls::PrivateKeyType;
pub use tls::SelfSignedGenerator;

Modules§

balancer
Load balancing strategies for distributing requests across endpoints
circuit_breaker
Circuit breaker pattern implementation for fault tolerance
client
gRPC client implementation with connection pooling
convert
Conversions between protocol buffer types and core types
error
Error types for the network layer
grpc_service
gRPC service bridge implementation
mtls
Mutual TLS (mTLS) authentication for AmateRS networking layer
pool
Connection pool implementation for managing reusable connections
proto
server
gRPC server implementation for AmateRS AQL Service
tls
TLS certificate management for AmateRS networking layer

Constants§

PROTOCOL_VERSION
Protocol version
VERSION
Library version