pdk-classy 1.9.1-alpha.2

PDK Classy
Documentation
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file

//! Classy - an asynchronous policy development kit
//!
//! An abstraction layer over the proxy_wasm framework that transforms the event oriented framework into an async/await model.
//!
//! Features
//!
//! - `experimental_metrics`: USE AT OWN RISK: experimental items that may change without notice. Exposes the API for host metrics.

mod context;
mod entrypoint;
mod handler;
mod host;
mod reactor;
mod types;
mod utils;

pub mod bootstrap;
pub mod client;
pub mod event;
pub mod extract;
pub mod grpc;
pub mod stream;
pub mod timer;
pub mod user_agent;

pub mod hl;

#[cfg(feature = "middleware")]
pub mod middleware;

#[cfg(not(feature = "middleware"))]
pub mod middleware;

pub mod plugin;
pub mod shared_data;

pub(crate) mod conversions;
pub(crate) mod http_constants;
pub(crate) mod macros;

pub use entrypoint::Entrypoint;
pub use extract::config::Configuration;

#[cfg(feature = "host")]
pub use host::{
    clock::{Clock, DefaultClock, TimeUnit},
    shared_data::SharedData,
    DefaultHost, Host,
};

#[cfg(all(feature = "host", feature = "experimental_metrics"))]
pub use host::metrics::{MetricType, MetricsHost};

pub use plugin::Plugin;

/// Wrapper for a generic error.
pub type BoxError = Box<dyn std::error::Error>;
pub(crate) type BoxFuture<'c, Out> = std::pin::Pin<Box<dyn std::future::Future<Output = Out> + 'c>>;

// Due to a linker error in Windows (https://github.com/rust-lang/rust/issues/86125) that fails when
// importing a crate that has external symbols, even when they are not being used, we need a
// proxy-wasm-stub for non wasm32 targets that does not define any extern functions in order to be
// able to run cargo test (which does not and can not use wasm32 as compilation target)
#[cfg(target_arch = "wasm32")]
pub use proxy_wasm;
#[cfg(not(target_arch = "wasm32"))]
pub use proxy_wasm_stub as proxy_wasm;