pub fn use_aead<F, T>(version: Version, f: F) -> Res<T>
where
    F: FnOnce(&Aead) -> Res<T>,
{
    match version {
        Version::Version2 => &RETRY_AEAD_V2,
        Version::Version1 => &RETRY_AEAD_V1,
        Version::Draft29 | Version::Draft30 | Version::Draft31 | Version::Draft32 => &RETRY_AEAD_29,
    }
    .try_with(|aead| f(&aead.borrow()))
    .map_err(|e| {
        qerror!("Unable to access Retry AEAD: {:?}", e);
        Error::InternalError(6)
    })?
}
/// Run a function with the appropriate Retry AEAD.
Run a function with the appropriate Retry AEAD.
Run a function with the appropriate Retry AEAD .
pub fn use_aead<F, T>(version: Version, f: F) -> Res<T>
where
    F: FnOnce(&Aead) -> Res<T>,
{
    match version {
        Version::Version2 => &RETRY_AEAD_V2,
        Version::Version1 => &RETRY_AEAD_V1,
        Version::Draft29 | Version::Draft30 | Version::Draft31 | Version::Draft32 => &RETRY_AEAD_29,
    }
    .try_with(|aead| f(&aead.borrow()))
    .map_err(|e| {
        qerror!("Unable to access Retry AEAD: {:?}", e);
        Error::InternalError(6)
    })?
}
pub fn use_aead < F , T > ( version : Version , f : F ) -> Res < T > where F : FnOnce ( & Aead ) -> Res < T > , { match version { Version :: Version2 => & RETRY_AEAD_V2 , Version :: Version1 => & RETRY_AEAD_V1 , Version :: Draft29 | Version :: Draft30 | Version :: Draft31 | Version :: Draft32 => & RETRY_AEAD_29 , } . try_with ( | aead | f ( & aead . borrow ( ) ) ) . map_err ( | e | { qerror ! ( " " e ) ; Error :: InternalError ( 6 ) } ) ? }
Run a function with the appropriate Retry AEAD.
Run a function with the appropriate Retry AEAD .
version
Version
f
F