pub struct IdempotencyHandler { /* private fields */ }Expand description
Idempotency handler for write operations
Implementations§
Source§impl IdempotencyHandler
impl IdempotencyHandler
Sourcepub fn new() -> Result<Self, IdempotencyError>
pub fn new() -> Result<Self, IdempotencyError>
Create a new handler
Sourcepub fn check(
&self,
idempotency_key: Option<String>,
team_id: String,
user_id: String,
method: String,
params: &Map<String, Value>,
) -> Result<IdempotencyCheckResult, IdempotencyError>
pub fn check( &self, idempotency_key: Option<String>, team_id: String, user_id: String, method: String, params: &Map<String, Value>, ) -> Result<IdempotencyCheckResult, IdempotencyError>
Check if operation should be executed or replayed
§Arguments
idempotency_key- Optional idempotency keyteam_id- Team IDuser_id- User IDmethod- API method nameparams- Request parameters for fingerprinting
§Returns
Ok(IdempotencyCheckResult)with next actionErr(IdempotencyError)if fingerprint mismatch or other error
Sourcepub fn store(
&mut self,
key: ScopedKey,
fingerprint: RequestFingerprint,
response: Value,
) -> Result<(), IdempotencyError>
pub fn store( &mut self, key: ScopedKey, fingerprint: RequestFingerprint, response: Value, ) -> Result<(), IdempotencyError>
Store operation result
Auto Trait Implementations§
impl Freeze for IdempotencyHandler
impl RefUnwindSafe for IdempotencyHandler
impl Send for IdempotencyHandler
impl Sync for IdempotencyHandler
impl Unpin for IdempotencyHandler
impl UnwindSafe for IdempotencyHandler
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