[][src]Struct bundled_crypto::RotatingKeyStore

pub struct RotatingKeyStore<A: Algo> {
    pub algo: Arc<A>,
    pub last: Arc<A::Key>,
    pub curr: Arc<A::Key>,
}

A Send/Sync key store that keeps the last two keys.

Fields

algo: Arc<A>

A pointer to the algorithm.

last: Arc<A::Key>

A pointer to the previous key. TODO: Rename as prev.

curr: Arc<A::Key>

A pointer to the current key.

Methods

impl<K: SafeGenerateKey + Clone + Send + Sync, A: Algo<Key = K>> KeyStore<A>[src]

pub fn attempt_with_retry<T, E, F>(&self, attempt: &mut F) -> Result<T, E> where
    F: FnMut(&K, Option<E>) -> Result<T, E>, 
[src]

Attempt to use the current key, then the previous key. The function attempt takes in a key, and an optional result, which is populated if the first attempt fails.

Auto Trait Implementations

impl<A> Send for KeyStore<A> where
    A: Send + Sync,
    <A as Algo>::Key: Send + Sync

impl<A> Unpin for KeyStore<A>

impl<A> Sync for KeyStore<A> where
    A: Send + Sync,
    <A as Algo>::Key: Send + Sync

impl<A> UnwindSafe for KeyStore<A> where
    A: RefUnwindSafe,
    <A as Algo>::Key: RefUnwindSafe

impl<A> RefUnwindSafe for KeyStore<A> where
    A: RefUnwindSafe,
    <A as Algo>::Key: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,