Struct ckb_proposal_table::ProposalTable [−][src]
pub struct ProposalTable { /* fields omitted */ }Expand description
A Table record proposals set in number-ids pairs
Implementations
Create new ProposalTable from ProposalWindow
Inserts a number-ids pair into the table. If the TABLE did not have this number present, true is returned. If the map did have this number present, the proposal set is updated.
Removes a proposal set from the table, returning the set at the number if the number was previously in the table
Examples
use ckb_chain_spec::consensus::ProposalWindow; use ckb_proposal_table::ProposalTable; let window = ProposalWindow(2, 10); let mut table = ProposalTable::new(window); assert_eq!(table.remove(1), None);
Return referent of internal BTreeMap contains all proposal set
pub fn finalize(
&mut self,
origin: &ProposalView,
number: BlockNumber
) -> (HashSet<ProposalShortId>, ProposalView)
pub fn finalize(
&mut self,
origin: &ProposalView,
number: BlockNumber
) -> (HashSet<ProposalShortId>, ProposalView)
Update table by proposal window move froward, drop outdated proposal set Return removed proposal ids set and new ProposalView
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for ProposalTable
impl Send for ProposalTable
impl Sync for ProposalTable
impl Unpin for ProposalTable
impl UnwindSafe for ProposalTable
Blanket Implementations
Mutably borrows from an owned value. Read more