Struct exonum_configuration::ProposeData
[−]
pub struct ProposeData { /* fields omitted */ }
Extended information about a proposal used for the storage.
Methods
impl ProposeData
pub fn new(
tx_propose: Propose,
votes_history_hash: &Hash,
num_validators: u64
) -> ProposeData
tx_propose: Propose,
votes_history_hash: &Hash,
num_validators: u64
) -> ProposeData
Creates a new instance with given parameters.
pub fn tx_propose(&self) -> Propose
Proposal transaction.
pub fn votes_history_hash(&self) -> &Hash
Merkle root of all votes for the proposal.
pub fn num_validators(&self) -> u64
Number of eligible voting validators.
impl ProposeData
[src]
pub fn set_history_hash(self, hash: &Hash) -> Self
[src]
Changes the votes_history_hash
field of this structure, leaving other fields intact.
Trait Implementations
impl Clone for ProposeData
fn clone(&self) -> ProposeData
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 PartialEq for ProposeData
fn eq(&self, __arg_0: &ProposeData) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ProposeData) -> bool
This method tests for !=
.
impl<'a> Field<'a> for ProposeData
unsafe fn read(buffer: &'a [u8], from: Offset, to: Offset) -> Self
Read Field from buffer, with given position, beware of memory unsafety, you should check
Field
before read
. Read more
fn write(&self, buffer: &mut Vec<u8>, from: Offset, to: Offset)
Write Field to buffer, in given position write
doesn't lead to memory unsafety. Read more
fn check(
buffer: &'a [u8],
from_st_val: CheckedOffset,
to_st_val: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
buffer: &'a [u8],
from_st_val: CheckedOffset,
to_st_val: CheckedOffset,
latest_segment: CheckedOffset
) -> Result
Checks if data in the buffer could be deserialized. Returns an index of latest data seen. Read more
fn field_size() -> Offset
Field's header size
impl CryptoHash for ProposeData
impl StorageValue for ProposeData
fn into_bytes(self) -> Vec<u8>
Serialize a value into a vector of bytes.
fn from_bytes(v: Cow<[u8]>) -> Self
Deserialize a value from bytes.
impl Debug for ProposeData
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl ExonumJson for ProposeData
fn deserialize_field<B>(
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>> where
B: WriteBufferWrapper,
value: &Value,
buffer: &mut B,
from: Offset,
to: Offset
) -> Result<(), Box<Error>> where
B: WriteBufferWrapper,
write deserialized field in buffer on place.
fn serialize_field(&self) -> Result<Value, Box<Error + Send + Sync>>
serialize field as json::Value
impl ExonumJsonDeserialize for ProposeData
fn deserialize(value: &Value) -> Result<Self, Box<Error>>
deserialize json
value.
impl<'de> Deserialize<'de> for ProposeData
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more