use async_trait::async_trait;
pub enum VadePluginResultValue<T> {
NotImplemented,
Ignored,
Success(T),
}
impl<T> VadePluginResultValue<T> {
pub fn unwrap(self) -> T {
match self {
VadePluginResultValue::Success(val) => val,
VadePluginResultValue::NotImplemented => {
panic!("called `VadePluginResultValue::unwrap()` on a `NotImplemented` value")
}
VadePluginResultValue::Ignored => {
panic!("called `VadePluginResultValue::unwrap()` on a `Ignored` value")
}
}
}
}
#[async_trait(?Send)]
#[allow(unused_variables)] pub trait VadePlugin {
async fn did_create(
&mut self,
did_method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn did_resolve(
&mut self,
_did: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn did_update(
&mut self,
did: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn didcomm_receive(
&mut self,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn didcomm_send(
&mut self,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn run_custom_function(
&mut self,
method: &str,
function: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_create_credential_definition(
&mut self,
did_method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_create_credential_offer(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_create_credential_proposal(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_create_credential_schema(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_create_revocation_registry_definition(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_update_revocation_registry(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_issue_credential(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_finish_credential(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_present_proof(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_propose_proof(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_request_credential(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_request_proof(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_revoke_credential(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
async fn vc_zkp_verify_proof(
&mut self,
method: &str,
options: &str,
payload: &str,
) -> Result<VadePluginResultValue<Option<String>>, Box<dyn std::error::Error>> {
Ok(VadePluginResultValue::NotImplemented)
}
}