pub struct IdempotencyPlugin { /* private fields */ }Expand description
Process-wide IdempotencyPlugin singleton holding policy, store, and prebuilt error wire buffers.
Implementations§
Source§impl IdempotencyPlugin
Process-wide singleton management and request evaluation helpers for IdempotencyPlugin.
impl IdempotencyPlugin
Process-wide singleton management and request evaluation helpers for IdempotencyPlugin.
Sourcepub fn init(config: IdempotencyConfig) -> &'static Self
pub fn init(config: IdempotencyConfig) -> &'static Self
Initializes the global IdempotencyPlugin once with config and the default 64-shard store.
§Arguments
IdempotencyConfig- Idempotency policy and memory limits.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn init_with_store(
config: IdempotencyConfig,
store: Arc<dyn IdempotencyStore>,
) -> &'static Self
pub fn init_with_store( config: IdempotencyConfig, store: Arc<dyn IdempotencyStore>, ) -> &'static Self
Initializes the global IdempotencyPlugin once with config and a custom IdempotencyStore.
§Arguments
IdempotencyConfig- Idempotency policy.Arc<dyn IdempotencyStore>- Custom or distributed backing store.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn new_instance(
config: IdempotencyConfig,
store: Arc<dyn IdempotencyStore>,
) -> Self
pub fn new_instance( config: IdempotencyConfig, store: Arc<dyn IdempotencyStore>, ) -> Self
Constructs a standalone IdempotencyPlugin instance (useful for isolated tests or custom hooks).
§Arguments
IdempotencyConfig- Idempotency policy.Arc<dyn IdempotencyStore>- Backing store.
§Returns
Self- Constructed plugin instance with prebuilt error wire buffers.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global IdempotencyPlugin, if initialized.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn get_config(&self) -> &IdempotencyConfig
pub fn get_config(&self) -> &IdempotencyConfig
Sourcepub fn get_store(&self) -> &Arc<dyn IdempotencyStore> ⓘ
pub fn get_store(&self) -> &Arc<dyn IdempotencyStore> ⓘ
Returns the active Arc<dyn IdempotencyStore>.
§Returns
&Arc<dyn IdempotencyStore>- Active backing store.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for IdempotencyPlugin
impl !UnwindSafe for IdempotencyPlugin
impl Forget for IdempotencyPlugin
impl Freeze for IdempotencyPluginwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Method>: Freeze,
PhantomData<String>: Freeze,
*const [String] is !null: Freeze,
PhantomData<[String]>: Freeze,
*const ArcInner<dyn IdempotencyStore> is !null: Freeze,
PhantomData<ArcInner<dyn IdempotencyStore>>: Freeze,
*const ArcInner<InMemoryIdempotencyStoreInner> is !null: Freeze,
PhantomData<ArcInner<InMemoryIdempotencyStoreInner>>: Freeze,
impl Move for IdempotencyPlugin
impl Send for IdempotencyPlugin
impl Sync for IdempotencyPlugin
impl Unpin for IdempotencyPlugin
impl UnsafeUnpin for IdempotencyPluginwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Method>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const [String] is !null: UnsafeUnpin,
PhantomData<[String]>: UnsafeUnpin,
*const ArcInner<dyn IdempotencyStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn IdempotencyStore>>: UnsafeUnpin,
*const ArcInner<InMemoryIdempotencyStoreInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<InMemoryIdempotencyStoreInner>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone 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