Struct ckb_proposal_table::ProposalView
source · pub struct ProposalView { /* private fields */ }Expand description
A view captures point-time proposal set, representing on-chain proposed transaction pool, stored in the memory so that there is no need to fetch on hard disk, create by ProposalTable finalize method w_close and w_far define the closest and farthest on-chain distance between a transaction’s proposal and commitment.
Implementations§
source§impl ProposalView
impl ProposalView
sourcepub fn new(
gap: HashSet<ProposalShortId>,
set: HashSet<ProposalShortId>
) -> ProposalView
pub fn new( gap: HashSet<ProposalShortId>, set: HashSet<ProposalShortId> ) -> ProposalView
Create new ProposalView
sourcepub fn gap(&self) -> &HashSet<ProposalShortId>
pub fn gap(&self) -> &HashSet<ProposalShortId>
Return proposals between w_close and tip
sourcepub fn set(&self) -> &HashSet<ProposalShortId>
pub fn set(&self) -> &HashSet<ProposalShortId>
Return proposals between w_close and w_far
sourcepub fn contains_proposed(&self, id: &ProposalShortId) -> bool
pub fn contains_proposed(&self, id: &ProposalShortId) -> bool
Returns true if the proposals set between w_close and w_far contains the id.
sourcepub fn contains_gap(&self, id: &ProposalShortId) -> bool
pub fn contains_gap(&self, id: &ProposalShortId) -> bool
Returns true if the proposals set between w_close and tip contains the id.
Trait Implementations§
source§impl Clone for ProposalView
impl Clone for ProposalView
source§fn clone(&self) -> ProposalView
fn clone(&self) -> ProposalView
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ProposalView
impl Debug for ProposalView
source§impl Default for ProposalView
impl Default for ProposalView
source§fn default() -> ProposalView
fn default() -> ProposalView
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ProposalView
impl Send for ProposalView
impl Sync for ProposalView
impl Unpin for ProposalView
impl UnwindSafe for ProposalView
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