Struct cryptoballot::Signed[][src]

pub struct Signed<T: CryptoBallotTransaction + Serialize> {
    pub tx: T,
    pub sig: Signature,
}
Expand description

A generic signed transaction

Fields

tx: Tsig: Signature

Implementations

impl<T: CryptoBallotTransaction + Serialize> Signed<T>[src]

pub fn sign(secret: &SecretKey, transaction: T) -> Result<Self, Error>[src]

Sign a transaction, producing a Signed

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

Verify the signature on a signed transaction

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

Get the inner unsigned transaction

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

Get the transaction ID

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

Verify the signature and validate the transaction

Trait Implementations

impl<T: CryptoBallotTransaction + Serialize> AsRef<T> for Signed<T>[src]

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

Performs the conversion.

impl<T: Clone + CryptoBallotTransaction + Serialize> Clone for Signed<T>[src]

fn clone(&self) -> Signed<T>[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<T: CryptoBallotTransaction + Serialize> Deref for Signed<T>[src]

type Target = T

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

Dereferences the value.

impl<'de, T: CryptoBallotTransaction + Serialize> Deserialize<'de> for Signed<T> where
    T: Deserialize<'de>, 
[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 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<T: CryptoBallotTransaction + Serialize> Serialize for Signed<T> where
    T: Serialize
[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<T> RefUnwindSafe for Signed<T> where
    T: RefUnwindSafe

impl<T> Send for Signed<T> where
    T: Send

impl<T> Sync for Signed<T> where
    T: Sync

impl<T> Unpin for Signed<T> where
    T: Unpin

impl<T> UnwindSafe for Signed<T> where
    T: UnwindSafe

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> ToHex for T where
    T: AsRef<[u8]>, 
[src]

pub fn encode_hex<U>(&self) -> U where
    U: FromIterator<char>, 
[src]

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca) Read more

pub fn encode_hex_upper<U>(&self) -> U where
    U: FromIterator<char>, 
[src]

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA) Read more

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

pub fn write_hex<W>(&self, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Writes the hex string representing self into w. Lower case letters are used (e.g. f9b4ca). Read more

pub fn write_hex_upper<W>(&self, w: &mut W) -> Result<(), Error> where
    W: Write
[src]

Writes the hex string representing self into w. Upper case letters are used (e.g. F9B4CA). Read more

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]