pub struct CredentialData {
pub credentials: Vec<Credential>,
pub use_native: Option<bool>,
pub primary_index: Option<u8>,
}Expand description
CredentialData is wrapper for dealing with multiple credentials at the same time.
Implements both Verifiable and CredentialWrapper traits.
Fields§
§credentials: Vec<Credential>The list of credentials to be verified
use_native: Option<bool>A flag indicating that the environment can derive an additional credential that isn’t included in the list of credentials directly. Most typically it’s the transaction signer that has been verified beforehand but can be any other authorized dicated by the environment / smart contract logic
primary_index: Option<u8>An optional index indicating which credential will be used as the primary. Default to the first one
Implementations§
Source§impl CredentialData
impl CredentialData
Sourcepub fn with_native<C>(&self, cal: C) -> CredentialData
pub fn with_native<C>(&self, cal: C) -> CredentialData
Check whether with_caller flag is set and then ether ignore the arguemnt and return a copy or constuct a new wrapper with the credential being set @param cal: native caller of the environment @return: checked wrapper and a flag indicating whether the copy deviated from the original Self
Trait Implementations§
Source§impl Clone for CredentialData
impl Clone for CredentialData
Source§fn clone(&self) -> CredentialData
fn clone(&self) -> CredentialData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CredentialsWrapper for CredentialData
impl CredentialsWrapper for CredentialData
type Credential = Credential
fn credentials( &self, ) -> &Vec<<CredentialData as CredentialsWrapper>::Credential>
fn primary_index(&self) -> Option<u8>
fn primary(&self) -> Self::Credential
fn primary_id(&self) -> String
Source§impl Debug for CredentialData
impl Debug for CredentialData
Source§impl<'de> Deserialize<'de> for CredentialData
impl<'de> Deserialize<'de> for CredentialData
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CredentialData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CredentialData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for CredentialData
impl JsonSchema for CredentialData
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more