pub struct IdempotencyKey(/* private fields */);Expand description
Represents valid idempotency key
- Cannot be empty
- Cannot be longer than 255 charachters
Implementations§
Source§impl IdempotencyKey
impl IdempotencyKey
Sourcepub fn new(val: impl AsRef<str>) -> Result<IdempotencyKey, IdempotentKeyError>
pub fn new(val: impl AsRef<str>) -> Result<IdempotencyKey, IdempotentKeyError>
Creates new validated idempotency key.
§Errors
This function returns error when they key is empty or when its longer than 255 characters
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consumes self and returns inner string
Trait Implementations§
Source§impl Clone for IdempotencyKey
impl Clone for IdempotencyKey
Source§fn clone(&self) -> IdempotencyKey
fn clone(&self) -> IdempotencyKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdempotencyKey
impl Debug for IdempotencyKey
Source§impl PartialEq for IdempotencyKey
impl PartialEq for IdempotencyKey
Source§impl TryFrom<String> for IdempotencyKey
impl TryFrom<String> for IdempotencyKey
Source§type Error = IdempotentKeyError
type Error = IdempotentKeyError
The type returned in the event of a conversion error.
Source§fn try_from(
value: String,
) -> Result<IdempotencyKey, <IdempotencyKey as TryFrom<String>>::Error>
fn try_from( value: String, ) -> Result<IdempotencyKey, <IdempotencyKey as TryFrom<String>>::Error>
Performs the conversion.
impl Eq for IdempotencyKey
impl StructuralPartialEq for IdempotencyKey
Auto Trait Implementations§
impl Freeze for IdempotencyKey
impl RefUnwindSafe for IdempotencyKey
impl Send for IdempotencyKey
impl Sync for IdempotencyKey
impl Unpin for IdempotencyKey
impl UnwindSafe for IdempotencyKey
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.