Struct libyobicash::models::input::Input
[−]
[src]
pub struct Input { pub id: Digest, pub proof: ZKPProof, }
An Input
is a reference to a past output used in transactions
to spend the output.
Fields
id: Digest
The id of the referenced output.
proof: ZKPProof
The zero-knowledge-proof proof used to spend the referenced output.
Methods
impl Input
[src]
pub fn new(coin: &Coin, message: &[u8]) -> Result<Input>
[src]
Creates an Input
.
pub fn verify(&self, output: &Output) -> Result<bool>
[src]
Verifies the Input
against an Output
.
Trait Implementations
impl Copy for Input
[src]
impl Clone for Input
[src]
fn clone(&self) -> Input
[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 Eq for Input
[src]
impl PartialEq for Input
[src]
fn eq(&self, __arg_0: &Input) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Input) -> bool
[src]
This method tests for !=
.
impl Default for Input
[src]
impl Debug for Input
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> Identify<'a> for Input
[src]
type ID = Digest
Type of the identifier.
fn id(&self) -> Result<Self::ID>
[src]
Returns the ID
of the implementor.
fn id_to_bytes(id: Self::ID) -> Result<Vec<u8>>
[src]
Converts an ID
to bytes.
fn id_from_bytes(b: &[u8]) -> Result<Self::ID>
[src]
Converts a binary to an ID
.
fn binary_id(&self) -> Result<Vec<u8>>
[src]
Returns the binary representation of the ID
of the object.
fn id_from_string(s: &str) -> Result<Self::ID>
[src]
Converts a string to an ID
.
fn id_to_string(id: Self::ID) -> Result<String>
[src]
Converts an ID
to string.
fn string_id(&self) -> Result<String>
[src]
Returns the string representation of the ID
of the object.
impl Validate for Input
[src]
impl<'a> Serialize<'a> for Input
[src]
fn to_json(&self) -> Result<String>
[src]
Serialize to a json string.
fn from_json(s: &str) -> Result<Self>
[src]
Deserialize from a json string.
fn to_bytes(&self) -> Result<Vec<u8>>
[src]
Serialize to a binary.
fn from_bytes(b: &[u8]) -> Result<Self>
[src]
Deserialize from a binary.
fn to_hex(&self) -> Result<String>
[src]
Serialize to a hex.
fn from_hex(s: &str) -> Result<Self>
[src]
Deserialize from a hex.