pub struct DataProposal {
pub parent_data_proposal_hash: DataProposalParent,
pub txs: Vec<Transaction>,
/* private fields */
}Fields§
§parent_data_proposal_hash: DataProposalParent§txs: Vec<Transaction>Implementations§
Source§impl DataProposal
impl DataProposal
pub fn new( parent_data_proposal_hash: DataProposalHash, txs: Vec<Transaction>, ) -> Self
pub fn new_root(lane_id: LaneId, txs: Vec<Transaction>) -> Self
pub fn remove_proofs(&mut self)
pub fn take_proofs(&mut self) -> Vec<(u64, ProofData)>
Sourcepub fn hydrate_proofs(&mut self, proofs: Vec<(u64, ProofData)>)
pub fn hydrate_proofs(&mut self, proofs: Vec<(u64, ProofData)>)
Proofs are kept as a vector because DP transactions are fundamentally ordered.
Sourcepub unsafe fn unsafe_set_hash(&mut self, hash: &DataProposalHash)
pub unsafe fn unsafe_set_hash(&mut self, hash: &DataProposalHash)
This is used to set the hash of the DataProposal when we can trust we know it (specifically - deserializating from local storage)
§Safety
Marked unsafe so you think twice before using it, but this is safe rust-wise.
Trait Implementations§
Source§impl BorshDeserialize for DataProposal
impl BorshDeserialize for DataProposal
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for DataProposal
impl BorshSerialize for DataProposal
Source§impl Clone for DataProposal
impl Clone for DataProposal
Source§impl DataSized for DataProposal
impl DataSized for DataProposal
fn estimate_size(&self) -> usize
Source§impl Debug for DataProposal
impl Debug for DataProposal
Source§impl<'de> Deserialize<'de> for DataProposal
impl<'de> Deserialize<'de> for DataProposal
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DataProposal
impl Display for DataProposal
Source§impl Hash for DataProposal
impl Hash for DataProposal
Source§impl Hashed<DataProposalHash> for DataProposal
impl Hashed<DataProposalHash> for DataProposal
fn hashed(&self) -> DataProposalHash
Source§impl PartialEq for DataProposal
impl PartialEq for DataProposal
Source§impl Serialize for DataProposal
impl Serialize for DataProposal
Source§impl TcpMessageLabel for DataProposal
impl TcpMessageLabel for DataProposal
fn message_label(&self) -> &'static str
impl Eq for DataProposal
Auto Trait Implementations§
impl !Freeze for DataProposal
impl RefUnwindSafe for DataProposal
impl Send for DataProposal
impl Sync for DataProposal
impl Unpin for DataProposal
impl UnsafeUnpin for DataProposal
impl UnwindSafe for DataProposal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.