pub struct TenantConfigStore { /* private fields */ }Available on crate feature
multi-tenant only.Expand description
Implementations§
Source§impl TenantConfigStore
impl TenantConfigStore
Sourcepub fn set_config(
&self,
tenant: TenantId,
config: TenantConfig,
) -> Result<(), ServerError>
pub fn set_config( &self, tenant: TenantId, config: TenantConfig, ) -> Result<(), ServerError>
Writes tenant config snapshot.
§Examples
use http_handle::tenant_isolation::{TenantConfig, TenantConfigStore, TenantId};
let store = TenantConfigStore::default();
let _ = store.set_config(TenantId("acme".into()), TenantConfig::default());
assert_eq!(1, 1);§Errors
Returns an error when the underlying lock is poisoned.
§Panics
This function does not panic.
Sourcepub fn get_config(
&self,
tenant: &TenantId,
) -> Result<Option<TenantConfig>, ServerError>
pub fn get_config( &self, tenant: &TenantId, ) -> Result<Option<TenantConfig>, ServerError>
Returns a cloned tenant config snapshot.
§Examples
use http_handle::tenant_isolation::{TenantConfigStore, TenantId};
let store = TenantConfigStore::default();
let _ = store.get_config(&TenantId("acme".into()));
assert_eq!(1, 1);§Errors
Returns an error when the underlying lock is poisoned.
§Panics
This function does not panic.
Trait Implementations§
Source§impl Debug for TenantConfigStore
impl Debug for TenantConfigStore
Source§impl Default for TenantConfigStore
impl Default for TenantConfigStore
Source§fn default() -> TenantConfigStore
fn default() -> TenantConfigStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for TenantConfigStore
impl RefUnwindSafe for TenantConfigStore
impl Send for TenantConfigStore
impl Sync for TenantConfigStore
impl Unpin for TenantConfigStore
impl UnsafeUnpin for TenantConfigStore
impl UnwindSafe for TenantConfigStore
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