pub struct TenantAwareInMemoryPushConfigStore { /* private fields */ }Expand description
Tenant-isolated in-memory PushConfigStore.
Maintains a separate InMemoryPushConfigStore per tenant for full
data isolation. The current tenant is determined from TenantContext.
§Example
use a2a_protocol_server::push::tenant_config_store::TenantAwareInMemoryPushConfigStore;
use a2a_protocol_server::push::PushConfigStore;
use a2a_protocol_server::store::tenant::TenantContext;
let store = TenantAwareInMemoryPushConfigStore::new();
// Scoped to tenant A
TenantContext::scope("tenant-a", async {
// store.set(config).await;
}).await;Implementations§
Source§impl TenantAwareInMemoryPushConfigStore
impl TenantAwareInMemoryPushConfigStore
Sourcepub fn new() -> TenantAwareInMemoryPushConfigStore
pub fn new() -> TenantAwareInMemoryPushConfigStore
Creates a new tenant-aware push config store with default limits.
Sourcepub fn with_limits(
max_tenants: usize,
max_configs_per_task: usize,
) -> TenantAwareInMemoryPushConfigStore
pub fn with_limits( max_tenants: usize, max_configs_per_task: usize, ) -> TenantAwareInMemoryPushConfigStore
Creates with custom limits.
Sourcepub async fn tenant_count(&self) -> usize
pub async fn tenant_count(&self) -> usize
Returns the number of active tenant partitions.
Trait Implementations§
Source§impl Default for TenantAwareInMemoryPushConfigStore
impl Default for TenantAwareInMemoryPushConfigStore
Source§fn default() -> TenantAwareInMemoryPushConfigStore
fn default() -> TenantAwareInMemoryPushConfigStore
Returns the “default value” for a type. Read more
Source§impl PushConfigStore for TenantAwareInMemoryPushConfigStore
impl PushConfigStore for TenantAwareInMemoryPushConfigStore
Source§fn set<'a>(
&'a self,
config: TaskPushNotificationConfig,
) -> Pin<Box<dyn Future<Output = Result<TaskPushNotificationConfig, A2aError>> + Send + 'a>>
fn set<'a>( &'a self, config: TaskPushNotificationConfig, ) -> Pin<Box<dyn Future<Output = Result<TaskPushNotificationConfig, A2aError>> + Send + 'a>>
Stores (creates or updates) a push notification config. Read more
Source§fn get<'a>(
&'a self,
task_id: &'a str,
id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
fn get<'a>( &'a self, task_id: &'a str, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<TaskPushNotificationConfig>, A2aError>> + Send + 'a>>
Retrieves a push notification config by task ID and config ID. Read more
Auto Trait Implementations§
impl !Freeze for TenantAwareInMemoryPushConfigStore
impl !RefUnwindSafe for TenantAwareInMemoryPushConfigStore
impl Send for TenantAwareInMemoryPushConfigStore
impl Sync for TenantAwareInMemoryPushConfigStore
impl Unpin for TenantAwareInMemoryPushConfigStore
impl UnsafeUnpin for TenantAwareInMemoryPushConfigStore
impl !UnwindSafe for TenantAwareInMemoryPushConfigStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request