[][src]Trait dubp_documents::Document

pub trait Document: Debug + Clone + PartialEq + Eq {
    type PublicKey: PublicKey;
    type CurrencyType: ?Sized;
    fn version(&self) -> u16;
fn currency(&self) -> &Self::CurrencyType;
fn blockstamp(&self) -> Blockstamp;
fn issuers(&self) -> &Vec<Self::PublicKey>;
fn signatures(&self) -> &Vec<<Self::PublicKey as PublicKey>::Signature>;
fn as_bytes(&self) -> &[u8]; fn verify_signatures(&self) -> VerificationResult { ... } }

trait providing commun methods for any documents of any protocol version.

Design choice

Allow only ed25519 for protocol 10 and many differents schemes for protocol 11 through a proxy type.

Associated Types

type PublicKey: PublicKey

Type of the PublicKey used by the document.

type CurrencyType: ?Sized

Data type of the currency code used by the document.

Loading content...

Required methods

fn version(&self) -> u16

Get document version.

fn currency(&self) -> &Self::CurrencyType

Get document currency.

fn blockstamp(&self) -> Blockstamp

Get document blockstamp

fn issuers(&self) -> &Vec<Self::PublicKey>

Iterate over document issuers.

fn signatures(&self) -> &Vec<<Self::PublicKey as PublicKey>::Signature>

Iterate over document signatures.

fn as_bytes(&self) -> &[u8]

Get document as bytes for signature verification.

Loading content...

Provided methods

fn verify_signatures(&self) -> VerificationResult

Verify signatures of document content (as text format)

Loading content...

Implementors

impl Document for BlockDocument[src]

impl Document for CertificationDocument[src]

impl Document for IdentityDocument[src]

impl Document for MembershipDocument[src]

impl Document for RevocationDocument[src]

impl Document for TransactionDocument[src]

Loading content...