use crate::{
http_client,
wasm_compat::{WasmBoxedFuture, WasmCompatSend},
};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum VerifyError {
#[error("invalid authentication")]
InvalidAuthentication,
#[error("provider error: {0}")]
ProviderError(String),
#[error("http error: {0}")]
HttpError(
#[from]
#[source]
http_client::Error,
),
}
pub trait VerifyClient {
fn verify(&self) -> impl Future<Output = Result<(), VerifyError>> + WasmCompatSend;
}
#[deprecated(
since = "0.25.0",
note = "`DynClientBuilder` and related features have been deprecated and will be removed in a future release. In this case, use `VerifyClient` instead."
)]
pub trait VerifyClientDyn {
fn verify(&self) -> WasmBoxedFuture<'_, Result<(), VerifyError>>;
}
#[allow(deprecated)]
impl<T> VerifyClientDyn for T
where
T: VerifyClient,
{
fn verify(&self) -> WasmBoxedFuture<'_, Result<(), VerifyError>> {
Box::pin(self.verify())
}
}