systemprompt-traits 0.75.0

Trait-first interface contracts for systemprompt.io AI governance infrastructure. Repository, provider, and service abstractions shared across the MCP governance pipeline.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! [`ProviderTokenCache`]: the handle an extension receives for the minted
//! upstream-token cache the platform owns.
//!
//! The cache itself lives in the security crate; this trait lets the
//! extension context hand it out without the shared layer naming that type.
//! The crate that owns the concrete cache recovers it with
//! [`ProviderTokenCache::into_any`].
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.

use std::any::Any;
use std::fmt::Debug;
use std::sync::Arc;

pub trait ProviderTokenCache: Any + Send + Sync + Debug {
    fn into_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync>;
}