pub struct ProposalTable { /* private fields */ }
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

Update table by proposal window move froward, drop outdated proposal set Return removed proposal ids set and new ProposalView

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

TODO(doc): @quake

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.