Enum cryptoballot::SignedTransaction[][src]

pub enum SignedTransaction {
    Election(Signed<ElectionTransaction>),
    KeyGenCommitment(Signed<KeyGenCommitmentTransaction>),
    KeyGenShare(Signed<KeyGenShareTransaction>),
    KeyGenPublicKey(Signed<KeyGenPublicKeyTransaction>),
    EncryptionKey(Signed<EncryptionKeyTransaction>),
    Vote(Signed<VoteTransaction>),
    VotingEnd(Signed<VotingEndTransaction>),
    Mix(Signed<MixTransaction>),
    PartialDecryption(Signed<PartialDecryptionTransaction>),
    Decryption(Signed<DecryptionTransaction>),
}
Expand description

A signed transaction

Variants

Election(Signed<ElectionTransaction>)
KeyGenCommitment(Signed<KeyGenCommitmentTransaction>)
KeyGenShare(Signed<KeyGenShareTransaction>)
KeyGenPublicKey(Signed<KeyGenPublicKeyTransaction>)
EncryptionKey(Signed<EncryptionKeyTransaction>)
Vote(Signed<VoteTransaction>)
VotingEnd(Signed<VotingEndTransaction>)
Mix(Signed<MixTransaction>)
PartialDecryption(Signed<PartialDecryptionTransaction>)
Decryption(Signed<DecryptionTransaction>)

Implementations

impl SignedTransaction[src]

pub fn transaction_type(&self) -> TransactionType[src]

Get the transaction type

pub fn as_bytes(&self) -> Vec<u8>[src]

Pack into bytes

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>[src]

Unpack from bytes

pub fn id(&self) -> Identifier[src]

Get the transaction ID

pub fn validate<S: Store>(&self, s: &S) -> Result<(), ValidationError>[src]

Validate the transaction. This does the following:

  1. Checks that the id-type matches the transaction-type
  2. Validates the signature
  3. Validates the transaction against the store

pub fn verify_signature(&self) -> Result<(), ValidationError>[src]

pub fn public(&self) -> Option<PublicKey>[src]

Trait Implementations

impl AsRef<DecryptionTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &DecryptionTransaction[src]

Performs the conversion.

impl AsRef<ElectionTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &ElectionTransaction[src]

Performs the conversion.

impl AsRef<EncryptionKeyTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &EncryptionKeyTransaction[src]

Performs the conversion.

impl AsRef<KeyGenCommitmentTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &KeyGenCommitmentTransaction[src]

Performs the conversion.

impl AsRef<KeyGenPublicKeyTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &KeyGenPublicKeyTransaction[src]

Performs the conversion.

impl AsRef<KeyGenShareTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &KeyGenShareTransaction[src]

Performs the conversion.

impl AsRef<MixTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &MixTransaction[src]

Performs the conversion.

impl AsRef<PartialDecryptionTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &PartialDecryptionTransaction[src]

Performs the conversion.

impl AsRef<VoteTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &VoteTransaction[src]

Performs the conversion.

impl AsRef<VotingEndTransaction> for SignedTransaction[src]

fn as_ref(&self) -> &VotingEndTransaction[src]

Performs the conversion.

impl Clone for SignedTransaction[src]

fn clone(&self) -> SignedTransaction[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'de> Deserialize<'de> for SignedTransaction[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<Signed<DecryptionTransaction>> for SignedTransaction[src]

fn from(tx: Signed<DecryptionTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<ElectionTransaction>> for SignedTransaction[src]

fn from(tx: Signed<ElectionTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<EncryptionKeyTransaction>> for SignedTransaction[src]

fn from(tx: Signed<EncryptionKeyTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<KeyGenCommitmentTransaction>> for SignedTransaction[src]

fn from(tx: Signed<KeyGenCommitmentTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<KeyGenPublicKeyTransaction>> for SignedTransaction[src]

fn from(tx: Signed<KeyGenPublicKeyTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<KeyGenShareTransaction>> for SignedTransaction[src]

fn from(tx: Signed<KeyGenShareTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<MixTransaction>> for SignedTransaction[src]

fn from(tx: Signed<MixTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<PartialDecryptionTransaction>> for SignedTransaction[src]

fn from(tx: Signed<PartialDecryptionTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<VoteTransaction>> for SignedTransaction[src]

fn from(tx: Signed<VoteTransaction>) -> Self[src]

Performs the conversion.

impl From<Signed<VotingEndTransaction>> for SignedTransaction[src]

fn from(tx: Signed<VotingEndTransaction>) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<ElectionTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<KeyGenCommitmentTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for ElectionTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for KeyGenCommitmentTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for KeyGenShareTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for KeyGenPublicKeyTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for EncryptionKeyTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for VoteTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for VotingEndTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for MixTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for DecryptionTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for PartialDecryptionTransaction[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<KeyGenShareTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<KeyGenPublicKeyTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<EncryptionKeyTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<VoteTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<VotingEndTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<MixTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<PartialDecryptionTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl From<SignedTransaction> for Signed<DecryptionTransaction>[src]

fn from(tx: SignedTransaction) -> Self[src]

Performs the conversion.

impl Serialize for SignedTransaction[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

impl RefUnwindSafe for SignedTransaction

impl Send for SignedTransaction

impl Sync for SignedTransaction

impl Unpin for SignedTransaction

impl UnwindSafe for SignedTransaction

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T[src]

pub const ALIGN: usize[src]

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)[src]

Drops the object pointed to by the given pointer. Read more

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

pub fn vzip(self) -> V[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]