#[cfg(doc)]
use super::{
AuthenticatorSelectionCriteria, CredProtect, CredentialCreationOptions, Extension,
PublicKeyCredentialCreationOptions, USER_HANDLE_MAX_LEN, USER_HANDLE_MIN_LEN, UserHandle,
UserVerificationRequirement,
};
use core::{
error::Error,
fmt::{self, Display, Formatter},
};
#[cfg(doc)]
use std::time::{Instant, SystemTime};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CreationOptionsErr {
PrfWithoutUserVerification,
CredProtectRequiredWithoutUserVerification,
HintsIncompatibleWithAuthAttachment,
InvalidTimeout,
}
impl Display for CreationOptionsErr {
#[inline]
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
f.write_str(match *self {
Self::PrfWithoutUserVerification => "prf extension was requested without requiring user verification",
Self::CredProtectRequiredWithoutUserVerification => "credProtect extension with a value of user verification required was requested without requiring user verification",
Self::HintsIncompatibleWithAuthAttachment => "hints are not compatible with the requested authenticator attachment modality",
Self::InvalidTimeout => "the timeout could not be added to the current Instant",
})
}
}
impl Error for CreationOptionsErr {}