pub trait TrustchainDataAPI {
// Provided methods
fn sign_data<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
bytes: &'life0 [u8],
did: &'life1 str,
linked_data_proof_options: Option<LinkedDataProofOptions>,
key_id: Option<&'life2 str>,
resolver: &'life3 dyn TrustchainResolver,
context_loader: &'life4 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<Credential, IssuerError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
fn verify_data<'life0, 'life1, 'life2, 'life3, 'async_trait, T, U>(
bytes: &'life0 [u8],
credential: &'life1 Credential,
linked_data_proof_options: Option<LinkedDataProofOptions>,
root_event_time: Timestamp,
verifier: &'life2 U,
context_loader: &'life3 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<DIDChain, DataCredentialError>> + Send + 'async_trait>>
where T: DIDResolver + Send + 'async_trait,
U: Verifier<T> + Send + Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}
Expand description
API for Trustchain DATA functionality.
Provided Methods§
Sourcefn sign_data<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
bytes: &'life0 [u8],
did: &'life1 str,
linked_data_proof_options: Option<LinkedDataProofOptions>,
key_id: Option<&'life2 str>,
resolver: &'life3 dyn TrustchainResolver,
context_loader: &'life4 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<Credential, IssuerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn sign_data<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
bytes: &'life0 [u8],
did: &'life1 str,
linked_data_proof_options: Option<LinkedDataProofOptions>,
key_id: Option<&'life2 str>,
resolver: &'life3 dyn TrustchainResolver,
context_loader: &'life4 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<Credential, IssuerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Signs data in the form of bytes.
Sourcefn verify_data<'life0, 'life1, 'life2, 'life3, 'async_trait, T, U>(
bytes: &'life0 [u8],
credential: &'life1 Credential,
linked_data_proof_options: Option<LinkedDataProofOptions>,
root_event_time: Timestamp,
verifier: &'life2 U,
context_loader: &'life3 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<DIDChain, DataCredentialError>> + Send + 'async_trait>>where
T: DIDResolver + Send + 'async_trait,
U: Verifier<T> + Send + Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn verify_data<'life0, 'life1, 'life2, 'life3, 'async_trait, T, U>(
bytes: &'life0 [u8],
credential: &'life1 Credential,
linked_data_proof_options: Option<LinkedDataProofOptions>,
root_event_time: Timestamp,
verifier: &'life2 U,
context_loader: &'life3 mut ContextLoader,
) -> Pin<Box<dyn Future<Output = Result<DIDChain, DataCredentialError>> + Send + 'async_trait>>where
T: DIDResolver + Send + 'async_trait,
U: Verifier<T> + Send + Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Verifies a data credential by hashing the data bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.