Skip to main content

Crate nebucloud_xds

Crate nebucloud_xds 

Source
Expand description

§nebucloud-xds

Production-ready xDS control plane library for Rust.

This crate provides a complete implementation of the xDS protocol for building Envoy control planes. It supports:

  • State-of-the-World (SotW) xDS protocol
  • Delta xDS protocol (incremental updates)
  • Aggregated Discovery Service (ADS)
  • Individual xDS services (CDS, LDS, RDS, EDS, SDS)

§Quick Start

use nebucloud_xds::prelude::*;
use std::sync::Arc;

// Create a cache
let cache = Arc::new(ShardedCache::new());

// Build a snapshot for a node
let snapshot = Snapshot::builder()
    .version("v1")
    .build();

// Set snapshot
cache.set_snapshot(NodeHash::from_id("node-1"), snapshot);

// Create server
let _server = XdsServer::builder()
    .cache(cache)
    .enable_sotw()
    .build()?;

§Architecture

This library is organized into several crates:

  • xds-core - Core types, traits, and error handling
  • xds-cache - Snapshot cache with watch notifications
  • xds-server - gRPC server implementation
  • xds-types - Generated protobuf types

This crate (nebucloud-xds) re-exports all public APIs for convenience.

§Design Principles

  1. No panics in library code - All errors are returned as Result
  2. No locks held across await points - Uses DashMap and careful design
  3. Type-safe resources - Generic Resource trait with registry
  4. Observable - Built-in metrics and tracing support

§Features

  • full - Enable all features (default)
  • sotw - State-of-the-World protocol
  • delta - Delta xDS protocol
  • compression - Response compression

Re-exports§

pub use xds_cache as cache;
pub use xds_core as core;
pub use xds_server as server;
pub use xds_types as types;

Modules§

prelude
Prelude module for convenient imports.
version
Version information for this crate.