pub struct TenantPlugin { /* private fields */ }Expand description
Compiled multi-tenant resolution engine backing TenantHook.
Implementations§
Source§impl TenantPlugin
Resolution engine for TenantPlugin.
impl TenantPlugin
Resolution engine for TenantPlugin.
Sourcepub fn new(
config: TenantConfig,
resolver: Option<Arc<dyn TenantResolver>>,
) -> Self
pub fn new( config: TenantConfig, resolver: Option<Arc<dyn TenantResolver>>, ) -> Self
Compiles a standalone TenantPlugin from config and an optional custom TenantResolver.
§Arguments
TenantConfig- Tenant configuration.Option<Arc<dyn TenantResolver>>- Optional dynamic resolver.
§Returns
Self- Compiled plugin.
Sourcepub fn init(config: TenantConfig) -> &'static Self
pub fn init(config: TenantConfig) -> &'static Self
Initializes the global TenantPlugin singleton once.
§Arguments
TenantConfig- Tenant configuration.
§Returns
&'static Self- Reference to the global plugin.
Sourcepub fn init_with_resolver(
config: TenantConfig,
resolver: Arc<dyn TenantResolver>,
) -> &'static Self
pub fn init_with_resolver( config: TenantConfig, resolver: Arc<dyn TenantResolver>, ) -> &'static Self
Initializes the global TenantPlugin singleton with a custom TenantResolver.
§Arguments
TenantConfig- Tenant configuration.Arc<dyn TenantResolver>- Dynamic tenant resolver.
§Returns
&'static Self- Reference to the global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global TenantPlugin, if configured.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Auto Trait Implementations§
impl !RefUnwindSafe for TenantPlugin
impl !UnwindSafe for TenantPlugin
impl Forget for TenantPlugin
impl Freeze for TenantPluginwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<TenantRecord>: Freeze,
PhantomData<String>: Freeze,
*const [String] is !null: Freeze,
PhantomData<[String]>: Freeze,
PhantomData<fn() -> XxHash3_64>: Freeze,
PhantomData<(String, TenantRecord)>: Freeze,
*const ArcInner<dyn TenantResolver> is !null: Freeze,
PhantomData<ArcInner<dyn TenantResolver>>: Freeze,
impl Move for TenantPlugin
impl Send for TenantPluginwhere
RawVecInner: Send,
BoxRaw<[String]>: Send,
RawTable<(String, TenantRecord)>: Send,
Arc<dyn TenantResolver>: Send,
impl Sync for TenantPluginwhere
RawVecInner: Sync,
BoxRaw<[String]>: Sync,
RawTable<(String, TenantRecord)>: Sync,
Arc<dyn TenantResolver>: Sync,
impl Unpin for TenantPlugin
impl UnsafeUnpin for TenantPluginwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<TenantRecord>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const [String] is !null: UnsafeUnpin,
PhantomData<[String]>: UnsafeUnpin,
PhantomData<fn() -> XxHash3_64>: UnsafeUnpin,
PhantomData<(String, TenantRecord)>: UnsafeUnpin,
*const ArcInner<dyn TenantResolver> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn TenantResolver>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendSync for T
impl<T> AnySync for T
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